diff --git a/GameData/Waterfall/Plugins/Waterfall.dll b/GameData/Waterfall/Plugins/Waterfall.dll index 6d7acc41..0962f3cc 100644 Binary files a/GameData/Waterfall/Plugins/Waterfall.dll and b/GameData/Waterfall/Plugins/Waterfall.dll differ diff --git a/GameData/Waterfall/Plugins/Waterfall.pdb b/GameData/Waterfall/Plugins/Waterfall.pdb index cb2784e0..d0249032 100644 Binary files a/GameData/Waterfall/Plugins/Waterfall.pdb and b/GameData/Waterfall/Plugins/Waterfall.pdb differ diff --git a/GameData/Waterfall/Templates/waterfall-srb-smoke-1.cfg b/GameData/Waterfall/Templates/waterfall-srb-smoke-1.cfg deleted file mode 100644 index 11f2fb72..00000000 --- a/GameData/Waterfall/Templates/waterfall-srb-smoke-1.cfg +++ /dev/null @@ -1,851 +0,0 @@ -EFFECTTEMPLATE -{ - templateName = waterfall-srb-smoke-1 - EFFECT - { - name = eLight - parentName = thrustTransform - MODEL - { - path = Waterfall/FX/fx-point-light - positionOffset = 0,0,0 - rotationOffset = 0,0,0 - scaleOffset = 1,1,1 - LIGHT - { - intensity = 2.998353 - range = 31.6515675 - color = 0.964705884,0.890196085,0.776470602,1 - lightType = Spot - angle = 150 - transform = Light - baseTransform = - } - } - LIGHTFLOATMODIFIER - { - floatName = Intensity - controllerName = throttle - transformName = Light - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = tLight - combinationType = REPLACE - floatCurve - { - key = 0 0 0 0 - key = 0.1 8 0 0 - } - } - } - EFFECT - { - name = turbulent - parentName = thrustTransform - MODEL - { - path = Waterfall/FX/fx-stack - positionOffset = 0,0,0.600000024 - rotationOffset = -90,0,0 - scaleOffset = 0.100000001,6,0.100000001 - MATERIAL - { - transform = Waterfall/FX/fx-stack(Clone) - shader = Waterfall/Procedural Particles (Additive) - randomizeSeed = True - COLOR - { - colorName = _StartTint - colorValue = 1,0.481344342,0.296296299,1 - } - COLOR - { - colorName = _EndTint - colorValue = 0.90196079,0.376470596,0.0196078438,1 - } - FLOAT - { - floatName = _FadeIn - value = 0.0786824226 - } - FLOAT - { - floatName = _Speed - value = 100 - } - FLOAT - { - floatName = _Brightness - value = 10 - } - FLOAT - { - floatName = _Expand - value = 1.67387927 - } - FLOAT - { - floatName = _DetailScale - value = 2.5 - } - FLOAT - { - floatName = _Seed - value = 277.905457 - } - FLOAT - { - floatName = _Stretch - value = 0 - } - FLOAT - { - floatName = _Resolution - value = 2.28753066 - } - FLOAT - { - floatName = _Scale - value = 0.532634139 - } - FLOAT - { - floatName = _Exponent - value = 1.1430589 - } - FLOAT - { - floatName = _Turbulence - value = 4.08388424 - } - } - } - SCALEMODIFIER - { - controllerName = velocity - transformName = Waterfall/FX/fx-stack(Clone) - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = velscale - combinationType = REPLACE - xCurve - { - key = 0 1.4 0 0 - } - yCurve - { - key = 0 8 0 0 - key = 5000 15 0 0 - } - zCurve - { - key = 0 1.4 0 0 - } - } - FLOATMODIFIER - { - floatName = _Expand - controllerName = velocity - transformName = Waterfall/FX/fx-stack(Clone) - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = velspread - combinationType = REPLACE - floatCurve - { - key = 0 2 0 0 - key = 5000 4 0 0 - } - } - FLOATMODIFIER - { - floatName = _Brightness - controllerName = throttle - transformName = Waterfall/FX/fx-stack(Clone) - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = tBright - combinationType = REPLACE - floatCurve - { - key = 0 0 0 0 - key = 0.2 12 0 0 - } - } - FLOATMODIFIER - { - floatName = _Brightness - controllerName = atmosphereDepth - transformName = Waterfall/FX/fx-stack(Clone) - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = tAtmo - combinationType = MULTIPLY - floatCurve - { - key = 0 0 0 0 - key = 0.2 0 0 0 - key = 1 1 0 0 - } - } - FLOATMODIFIER - { - floatName = _Expand - controllerName = atmosphereDepth - transformName = Waterfall/FX/fx-stack(Clone) - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = aExp - combinationType = MULTIPLY - floatCurve - { - key = 0 2 0 0 - key = 1 0.4 0 0 - } - } - } - EFFECT - { - name = dynamicCore - parentName = thrustTransform - MODEL - { - path = Waterfall/FX/fx-cylinder - positionOffset = 0,0,-0.180000007 - rotationOffset = -90,0,0 - scaleOffset = 0.379999995,8,0.379999995 - MATERIAL - { - transform = Cylinder - shader = Waterfall/Additive (Dynamic) - randomizeSeed = True - TEXTURE - { - textureSlotName = _MainTex - texturePath = Waterfall/FX/fx-katniss-noise-1-blurred - textureScale = 1,1 - textureOffset = 0,0 - } - COLOR - { - colorName = _StartTint - colorValue = 0.91481483,0.461460501,0.32865569,1 - } - COLOR - { - colorName = _EndTint - colorValue = 0.90196079,0.533650756,0.137254909,1 - } - FLOAT - { - floatName = _ExpandLinear - value = 10 - } - FLOAT - { - floatName = _FadeOut - value = 0.419610471 - } - FLOAT - { - floatName = _Noise - value = 1.74416399 - } - FLOAT - { - floatName = _Fresnel - value = 0.657221198 - } - FLOAT - { - floatName = _Brightness - value = 2.7694416 - } - FLOAT - { - floatName = _Falloff - value = 3.48832798 - } - FLOAT - { - floatName = _TileX - value = 1 - } - FLOAT - { - floatName = _TileY - value = 1 - } - FLOAT - { - floatName = _TintFalloff - value = 1.06166506 - } - FLOAT - { - floatName = _SpeedY - value = 60.5667267 - } - FLOAT - { - floatName = _SpeedX - value = 0 - } - FLOAT - { - floatName = _FadeIn - value = 0.0202221908 - } - FLOAT - { - floatName = _ExpandSquare - value = 0.60666573 - } - } - } - FLOATMODIFIER - { - floatName = _Brightness - controllerName = throttle - transformName = Cylinder - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = tmult - combinationType = REPLACE - floatCurve - { - key = 0 0 0 0 - key = 0.1 4 0 0 - } - } - FLOATMODIFIER - { - floatName = _ExpandLinear - controllerName = velocity - transformName = Cylinder - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = vExp - combinationType = REPLACE - floatCurve - { - key = 0 3 0 0 - key = 5000 4 0 0 - } - } - FLOATMODIFIER - { - floatName = _ExpandLinear - controllerName = atmosphereDepth - transformName = Cylinder - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = aExp - combinationType = REPLACE - floatCurve - { - key = 0 9 0 0 - key = 1 3 0 0 - } - } - FLOATMODIFIER - { - floatName = _Falloff - controllerName = atmosphereDepth - transformName = Cylinder - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = aFade - combinationType = REPLACE - floatCurve - { - key = 0 30 0 0 - key = 1 4 0 0 - } - } - } - EFFECT - { - name = smoke - parentName = thrustTransform - MODEL - { - path = Waterfall/FX/fx-blank-1 - positionOffset = 0,0,2 - rotationOffset = 0,0,0 - scaleOffset = 1,1,1 - PARTICLE - { - transform = Waterfall/FX/fx-blank-1(Clone) - assetName = WaterfallSmokeProto2 - RANGE - { - rangeName = StartLifetime - value = 1,1.5 - } - } - } - PARTICLERANGEMODIFIER - { - controllerName = velocity - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = vSize - combinationType = REPLACE - paramName = StartSize - curve1 - { - key = 0 2 0 0 - key = 200 2 0.002 0.002 - key = 300 2.1 0 0 - key = 600 2.1 0 0 - key = 3003 5 0 0 - } - curve2 - { - key = 0 2 0 0 - key = 200 2 0.002 0.002 - key = 300 2.1 0 0 - key = 600 2.1 0 0 - key = 3003 5 0 0 - } - } - PARTICLERANGEMODIFIER - { - controllerName = velocity - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = startSpeed - combinationType = REPLACE - paramName = StartSpeed - curve1 - { - key = 0 75 0 0 - key = 75 15 -0.5 -0.5 - key = 150 0 0 0 - } - curve2 - { - key = 0 75 0 0 - key = 75 15 -0.5 -0.5 - key = 150 0 0 0 - } - } - PARTICLERANGEMODIFIER - { - controllerName = velocity - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = emit - combinationType = REPLACE - paramName = EmissionRate - curve1 - { - key = 0 125 0 0 - key = 2000 2000 0 0 - } - curve2 - { - key = 0 125 0 0 - key = 2000 2000 0 0 - } - } - PARTICLERANGEMODIFIER - { - controllerName = throttle - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = tEmissionRate - combinationType = MULTIPLY - paramName = EmissionRate - curve1 - { - key = 0 0 0 0 - key = 0.05 1 0 0 - } - curve2 - { - key = 0 0 0 0 - key = 0.05 1 0 0 - } - } - PARTICLERANGEMODIFIER - { - controllerName = atmosphereDepth - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = aEmitRate - combinationType = MULTIPLY - paramName = EmissionRate - curve1 - { - key = 0 0 0 0 - key = 0.4 0 0 0 - key = 0.43 1 0 0 - key = 1 1 0 0 - } - curve2 - { - key = 0 0 0 0 - key = 0.4 0 0 0 - key = 0.43 1 0 0 - key = 1 1 0 0 - } - } - PARTICLERANGEMODIFIER - { - controllerName = atmosphereDepth - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = aSize - combinationType = MULTIPLY - paramName = StartSize - curve1 - { - key = 0 3 0 0 - key = 0.8 1 0 0 - key = 1 1 0 0 - } - curve2 - { - key = 0 3 0 0 - key = 0.8 1 0 0 - key = 1 1 0 0 - } - } - PARTICLEFLOATMODIFIER - { - controllerName = velocity - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = vParticles - combinationType = REPLACE - paramName = MaxParticles - curve1 - { - key = 0 1000 0 0 - key = 5000 2500 0 0 - } - } - PARTICLEFLOATMODIFIER - { - controllerName = velocity - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = radius - combinationType = REPLACE - paramName = EmissionVolumeRadius - curve1 - { - key = 0 0 0 0 - key = 5000 0 0 0 - } - } - PARTICLECOLORMODIFIER - { - controllerName = atmosphereDepth - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = aColor - combinationType = REPLACE - paramName = StartColor - rCurve - { - key = 1 1 0 0 - } - gCurve - { - key = 1 1 0 0 - } - bCurve - { - key = 1 1 0 0 - } - aCurve - { - key = 0 0 0 0 - key = 0.3 0 0 0 - key = 1 0.3 0 0 - } - } - POSITIONMODIFIER - { - controllerName = velocity - transformName = WaterfallSmokeProto2(Clone) - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = vPos - combinationType = REPLACE - xCurve - { - } - yCurve - { - } - zCurve - { - key = 0 0 0 0 - key = 200 1 0 0.003 - key = 2500 3 0 0 - } - } - } - EFFECT - { - name = dynamicGlow - parentName = thrustTransform - MODEL - { - path = Waterfall/FX/fx-cylinder - positionOffset = 0,0,-0.0599999987 - rotationOffset = -90,0,0 - scaleOffset = 0.469999999,14,0.469999999 - MATERIAL - { - transform = Cylinder - shader = Waterfall/Additive (Dynamic) - randomizeSeed = True - TEXTURE - { - textureSlotName = _MainTex - texturePath = Waterfall/FX/fx-katniss-noise-1-blurred - textureScale = 1,1 - textureOffset = 0,0 - } - COLOR - { - colorName = _StartTint - colorValue = 0.91481483,0.720515609,0.335432112,1 - } - COLOR - { - colorName = _EndTint - colorValue = 0.988235295,0.152941182,0.152941182,1 - } - FLOAT - { - floatName = _ExpandLinear - value = 0.303332865 - } - FLOAT - { - floatName = _FadeOut - value = 0.419610471 - } - FLOAT - { - floatName = _Noise - value = 5.1491704 - } - FLOAT - { - floatName = _Fresnel - value = 0.202221915 - } - FLOAT - { - floatName = _Brightness - value = 2.7694416 - } - FLOAT - { - floatName = _Falloff - value = 6.87554502 - } - FLOAT - { - floatName = _TileX - value = 1 - } - FLOAT - { - floatName = _TileY - value = 1 - } - FLOAT - { - floatName = _TintFalloff - value = 1.44083107 - } - FLOAT - { - floatName = _SpeedY - value = 60.5667267 - } - FLOAT - { - floatName = _SpeedX - value = 0 - } - FLOAT - { - floatName = _ExpandBounded - value = 2.93221784 - } - FLOAT - { - floatName = _ExpandOffset - value = -0.10111095 - } - FLOAT - { - floatName = _FadeIn - value = 0.166833073 - } - FLOAT - { - floatName = _Symmetry - value = 3 - } - FLOAT - { - floatName = _SymmetryStrength - value = 0.707277417 - } - FLOAT - { - floatName = _ExpandSquare - value = 10 - } - } - } - COLORMODIFIER - { - colorName = _EndTint - controllerName = atmosphereDepth - transformName = Cylinder - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = brightAtmo - combinationType = REPLACE - rCurve - { - key = 0 0.9 0 0 - key = 1 0.9 0 0 - } - gCurve - { - key = 0 0.4 0 0 - key = 1 0.1 0 0 - } - bCurve - { - key = 0 0.1 0 0 - key = 1 0 0 0 - } - aCurve - { - } - } - FLOATMODIFIER - { - floatName = _Brightness - controllerName = throttle - transformName = Cylinder - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = tmult - combinationType = REPLACE - floatCurve - { - key = 0 0 0 0 - key = 0.1 1 0 0 - } - } - FLOATMODIFIER - { - floatName = _Brightness - controllerName = atmosphereDepth - transformName = Cylinder - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = brightAtmo - combinationType = MULTIPLY - floatCurve - { - key = 0 0.7 0 0 - key = 1 1 0 0 - } - } - FLOATMODIFIER - { - floatName = _ExpandBounded - controllerName = atmosphereDepth - transformName = Cylinder - useRandomness = False - randomnessController = random - randomnessScale = 1 - name = aExp - combinationType = REPLACE - floatCurve - { - key = 0 4 0 0 - key = 1 1 0 0 - } - } - FLOATMODIFIER - { - floatName = _FadeIn - controllerName = atmosphereDepth - transformName = Cylinder - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = fadeInAtmo - combinationType = REPLACE - floatCurve - { - key = 0 0 0 0 - key = 1 0 0 0 - } - } - FLOATMODIFIER - { - floatName = _Fresnel - controllerName = atmosphereDepth - transformName = Cylinder - useRandomness = False - randomnessController = RandomnessController - randomnessScale = 1 - name = aFresnel - combinationType = REPLACE - floatCurve - { - key = 0 0.2 0 0 - key = 1 0.8 0 0 - } - } - } -} diff --git a/GameData/Waterfall/Versioning/Waterfall.version b/GameData/Waterfall/Versioning/Waterfall.version index d4eaa304..928bda4b 100644 --- a/GameData/Waterfall/Versioning/Waterfall.version +++ b/GameData/Waterfall/Versioning/Waterfall.version @@ -6,7 +6,7 @@ { "MAJOR":0, "MINOR":10, - "PATCH":3, + "PATCH":5, "BUILD":0 }, "KSP_VERSION": diff --git a/Source/Waterfall/EffectControllers/CustomPullController.cs b/Source/Waterfall/EffectControllers/CustomPullController.cs index 0c1a7acb..6d6c56fd 100644 --- a/Source/Waterfall/EffectControllers/CustomPullController.cs +++ b/Source/Waterfall/EffectControllers/CustomPullController.cs @@ -45,7 +45,7 @@ public override void Initialize(ModuleWaterfallFX host) engineController = host.GetComponents().FirstOrDefault(x => x.engineID == engineID); if (engineController == null) { - Utils.Log($"[{nameof(CustomPullController)}]: Could not find engine ID {engineID}, using first module if available"); + Utils.Log($"[{nameof(CustomPullController)}]: Could not find engine ID {engineID}, using first module if available", LogType.Effects); engineController = host.part.FindModuleImplementing(); } diff --git a/Source/Waterfall/EffectControllers/EngineOnOffController.cs b/Source/Waterfall/EffectControllers/EngineOnOffController.cs new file mode 100644 index 00000000..93614a52 --- /dev/null +++ b/Source/Waterfall/EffectControllers/EngineOnOffController.cs @@ -0,0 +1,66 @@ +using System; +using System.ComponentModel; +using System.Linq; +using UnityEngine; + +namespace Waterfall +{ + [DisplayName("Engine On State")] + public class EngineOnOffController : WaterfallController + { + public float currentState = 0f; + [Persistent] public string engineID = String.Empty; + [Persistent] public float responseRateUp = 100f; + [Persistent] public float responseRateDown = 100f; + private ModuleEngines engineController; + + public bool zeroOnFlameout = true; + + public EngineOnOffController() : base() { } + public EngineOnOffController(ConfigNode node) : base(node) { } + + public override void Initialize(ModuleWaterfallFX host) + { + base.Initialize(host); + + values = new float[1]; + + engineController = host.GetComponents().FirstOrDefault(x => x.engineID == engineID); + if (engineController == null) + { + Utils.Log($"[EngineOnOffController] Could not find engine ID {engineID}, using first module", LogType.Effects); + engineController = host.part.FindModuleImplementing(); + } + else + { + currentState = engineController.isOperational ? 1f : 0f; + } + + if (engineController == null) + Utils.LogError("[EngineOnOffController] Could not find engine controller on Initialize"); + } + + protected override float UpdateSingleValue() + { + if (engineController == null) + { + Utils.LogWarning("[EngineOnOffController] Engine controller not assigned"); + return 0f; + } + else if (zeroOnFlameout) + { + float targetThrottle = engineController.isOperational && !engineController.flameout ? 1f : 0f; + + if (currentState != targetThrottle) + { + float rampRate = targetThrottle > currentState ? responseRateUp : responseRateDown; + currentState = Mathf.MoveTowards(currentState, targetThrottle, rampRate * TimeWarp.deltaTime); + } + + return currentState; + } + return currentState; + } + } +} + diff --git a/Source/Waterfall/EffectControllers/RemapController.cs b/Source/Waterfall/EffectControllers/RemapController.cs index b589c953..eade4057 100644 --- a/Source/Waterfall/EffectControllers/RemapController.cs +++ b/Source/Waterfall/EffectControllers/RemapController.cs @@ -40,20 +40,28 @@ private IEnumerator FindSourceDelayed() { yield return new WaitForEndOfFrame(); source = parentModule.FindController(sourceController); - values = new float[source.Get().Length]; + if (source == null) + { + Utils.LogError($"[RemapController] Could not find source controller {sourceController}"); + } + else + { + values = new float[source.Get().Length]; + } } protected override bool UpdateInternal() { - if (source != null) + if (source == null) return false; + + if (!source.awake) return false; + + float[] sourceValues = source.Get(); + for (int i = sourceValues.Length; i-- > 0;) { - float[] sourceValues = source.Get(); - for (int i = 0; i < sourceValues.Length; ++i) - { - values[i] = mappingCurve.Evaluate(sourceValues[i]); - } + values[i] = mappingCurve.Evaluate(sourceValues[i]); } - return false; - } + return true; + } } -} +} \ No newline at end of file diff --git a/Source/Waterfall/EffectControllers/ScalarModuleController.cs b/Source/Waterfall/EffectControllers/ScalarModuleController.cs new file mode 100644 index 00000000..f56e5dc6 --- /dev/null +++ b/Source/Waterfall/EffectControllers/ScalarModuleController.cs @@ -0,0 +1,48 @@ +using System; +using System.ComponentModel; +using System.Linq; + +namespace Waterfall +{ + /// + /// A controller that pulls from RCS throttle + /// + [Serializable] + [DisplayName("Scalar Module (AnimateGeneric)")] + public class ScalarModuleController : WaterfallController + { + private IScalarModule scalarController; + [Persistent] public string moduleID = String.Empty; + + public ScalarModuleController() : base() { } + public ScalarModuleController(ConfigNode node) : base(node) { } + + public override void Initialize(ModuleWaterfallFX host) + { + base.Initialize(host); + + values = new float[1]; + + scalarController = host.part.FindModulesImplementing().FirstOrDefault(x => x.ScalarModuleID == moduleID); + if (scalarController == null) + { + Utils.LogError($"[ScalarModuleController] Could not find a compatible module with ID {moduleID} on Initialize"); + values = new float[0]; + return; + } + } + + protected override float UpdateSingleValue() + { + if (scalarController == null) + { + Utils.LogWarning("[ScalarModuleController] Scalar module not assigned"); + return 0; + } + else + { + return scalarController.GetScalar; + } + } + } +} diff --git a/Source/Waterfall/EffectControllers/ThrottleController.cs b/Source/Waterfall/EffectControllers/ThrottleController.cs index bfe76bbe..6cd93723 100644 --- a/Source/Waterfall/EffectControllers/ThrottleController.cs +++ b/Source/Waterfall/EffectControllers/ThrottleController.cs @@ -32,7 +32,7 @@ public override void Initialize(ModuleWaterfallFX host) engineController = host.GetComponents().FirstOrDefault(x => x.engineID == engineID); if (engineController == null) { - Utils.Log($"[ThrottleController] Could not find engine ID {engineID}, using first module"); + Utils.Log($"[ThrottleController] Could not find engine ID {engineID}, using first module", LogType.Effects); engineController = host.part.FindModuleImplementing(); } diff --git a/Source/Waterfall/EffectControllers/ThrustController.cs b/Source/Waterfall/EffectControllers/ThrustController.cs index 78b6c1ff..09b4065f 100644 --- a/Source/Waterfall/EffectControllers/ThrustController.cs +++ b/Source/Waterfall/EffectControllers/ThrustController.cs @@ -29,7 +29,7 @@ public override void Initialize(ModuleWaterfallFX host) engineController = host.GetComponents().FirstOrDefault(x => x.engineID == engineID); if (engineController == null) { - Utils.Log($"[ThrustController] Could not find engine ID {engineID}, using first module"); + Utils.Log($"[ThrustController] Could not find engine ID {engineID}, using first module", LogType.Effects); engineController = host.part.FindModuleImplementing(); } diff --git a/Source/Waterfall/Modules/ModuleWaterfallFX.cs b/Source/Waterfall/Modules/ModuleWaterfallFX.cs index 7becd6c0..4a07870c 100644 --- a/Source/Waterfall/Modules/ModuleWaterfallFX.cs +++ b/Source/Waterfall/Modules/ModuleWaterfallFX.cs @@ -661,7 +661,7 @@ protected void InitializeEffects() activeFX.Clear(); foreach (var fx in allFX) { - Utils.Log($"[ModuleWaterfallFX]: Initializing effect {fx.name}"); + Utils.Log($"[ModuleWaterfallFX]: Initializing effect {fx.name}", LogType.Modules); if (fx.InitializeEffect(this, false, useRelativeScaling)) { activeFX.Add(fx); diff --git a/Source/Waterfall/UI/EditWindows/UICurveEditWindow.cs b/Source/Waterfall/UI/EditWindows/UICurveEditWindow.cs index 8fa06596..f1f792f1 100644 --- a/Source/Waterfall/UI/EditWindows/UICurveEditWindow.cs +++ b/Source/Waterfall/UI/EditWindows/UICurveEditWindow.cs @@ -18,7 +18,7 @@ public class UICurveEditWindow : UIPopupWindow public UICurveEditWindow(FastFloatCurve curveToEdit, bool show) : base(show) { - Utils.Log($"Started editing curve {curveToEdit}"); + Utils.Log($"[UICurveEditWindow] Started editing curve {curveToEdit}", LogType.UI); if (!showWindow) @@ -32,7 +32,7 @@ public UICurveEditWindow(FastFloatCurve curveToEdit, bool show) : base(show) public UICurveEditWindow(FastFloatCurve curveToEdit, CurveUpdateFunction curveFun, bool show) : base(show) { curveUpdateFun = curveFun; - Utils.Log($"Started editing curve {curveToEdit}"); + Utils.Log($"[UICurveEditWindow]: Started editing curve {curveToEdit}", LogType.UI); if (!showWindow) WindowPosition = new(Screen.width / 2, Screen.height / 2, 678, 600); @@ -46,7 +46,7 @@ public UICurveEditWindow(FastFloatCurve curveToEdit, UIModifierWindow modWin, st { modifier = modWin; modifierTag = tag; - Utils.Log($"Started editing curve {curveToEdit}", LogType.UI); + Utils.Log($"[UICurveEditWindow]: Started editing curve {curveToEdit}", LogType.UI); if (!showWindow) WindowPosition = new(Screen.width / 2, Screen.height / 2, 678, 600); @@ -58,7 +58,7 @@ public UICurveEditWindow(FastFloatCurve curveToEdit, UIModifierWindow modWin, st public void ChangeCurve(FastFloatCurve curveToEdit) { - Utils.Log($"Started editing curve {curveToEdit}", LogType.UI); + Utils.Log($"[UICurveEditWindow]: Started editing curve {curveToEdit}", LogType.UI); curve = curveToEdit; points = GraphUtils.FastFloatCurveToPoints(curveToEdit); UpdateCurve(out curve); @@ -69,7 +69,7 @@ public void ChangeCurve(FastFloatCurve curveToEdit) public void ChangeCurve(FastFloatCurve curveToEdit, CurveUpdateFunction curveFun) { curveUpdateFun = curveFun; - Utils.Log($"Started editing curve {curveToEdit}", LogType.UI); + Utils.Log($"[UICurveEditWindow]: Started editing curve {curveToEdit}", LogType.UI); curve = curveToEdit; points = GraphUtils.FastFloatCurveToPoints(curveToEdit); UpdateCurve(out curve); @@ -81,7 +81,7 @@ public void ChangeCurve(FastFloatCurve curveToEdit, UIModifierWindow modWin, str { modifier = modWin; modifierTag = tag; - Utils.Log($"Started editing curve {curveToEdit}", LogType.UI); + Utils.Log($"[UICurveEditWindow]: Started editing curve {curveToEdit}", LogType.UI); curve = curveToEdit; points = GraphUtils.FastFloatCurveToPoints(curveToEdit); UpdateCurve(out curve); @@ -100,13 +100,10 @@ public void UpdateCurve(out FastFloatCurve theCurve) theCurve.FindMinMax(out float minTime, out minY, out float maxTime, out maxY); curve = theCurve; curveUpdateFun(curve); - //WaterfallUI.Instance.UpdateCurve(curve); textVersion = GraphUtils.PointsToString(points); graphTexture = GraphUtils.GenerateCurveTexture(texWidth, texHeight, curve, Color.green); } - - // public bool Compare(FastFloatCurve toCompare) { if (GraphUtils.FastFloatCurveToPoints(toCompare) != points) diff --git a/Source/Waterfall/UI/EditWindows/UIGradientEditWindow.cs b/Source/Waterfall/UI/EditWindows/UIGradientEditWindow.cs index e1cd851a..96d5b65e 100644 --- a/Source/Waterfall/UI/EditWindows/UIGradientEditWindow.cs +++ b/Source/Waterfall/UI/EditWindows/UIGradientEditWindow.cs @@ -307,7 +307,6 @@ protected void AddAlphaKey(float selTime) } public void DeleteAlphaKey(UIGradientAlphaKey selKey) { - Utils.Log("Delete Alpha key"); deleteAlphaList.Add(selKey); if (selectedKey == selKey) { @@ -336,7 +335,6 @@ public void SelectAlphaKey(UIGradientAlphaKey selKey) } public void StopAlphaKeyDrag() { - Utils.Log("Stopped dragging alpha key"); keyDrag = false; SelectAlphaKey(selectedKey); RegenerateGradient(); @@ -344,7 +342,6 @@ public void StopAlphaKeyDrag() bool keyDrag = false; public void StartKeyDrag() { - Utils.Log("Started key drag"); keyDrag = true; } @@ -415,7 +412,6 @@ protected void DrawColorKeys(Rect rect) protected void AddColorKey(float selTime) { - Utils.Log("Add Color key"); UIGradientColorKey newKey = new UIGradientColorKey(selTime, new Color( gradient.Evaluate(selTime).r, @@ -428,7 +424,6 @@ protected void AddColorKey(float selTime) } public void DeleteColorKey(UIGradientColorKey selKey) { - Utils.Log("Delete Color key"); deleteColorList.Add(selKey); if (selectedColorKey == selKey) { @@ -463,7 +458,6 @@ public void SelectColorKey(UIGradientColorKey selKey) } public void StopColorKeyDrag() { - Utils.Log("Stopped dragging color key"); keyDrag = false; SelectColorKey(selectedColorKey); RegenerateGradient(); diff --git a/Source/Waterfall/UI/EffectControllersUI/EngineOnOffControllerUIOptions.cs b/Source/Waterfall/UI/EffectControllersUI/EngineOnOffControllerUIOptions.cs new file mode 100644 index 00000000..f51cd46c --- /dev/null +++ b/Source/Waterfall/UI/EffectControllersUI/EngineOnOffControllerUIOptions.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UniLinq; + +namespace Waterfall.UI.EffectControllersUI +{ + public class EngineOnOffControllerUIOptions : DefaultEffectControllerUIOptions + { + private readonly string[] rampStrings; + private string[] engineIDOptions; + private int engineIndex; + private bool offOnFlameout; + private float rampRateUp = 100f; + private float rampRateDown = 100f; + + + public EngineOnOffControllerUIOptions() + { + rampStrings = new[] { rampRateUp.ToString(), rampRateDown.ToString() }; + } + + public override void DrawOptions() + { + GUILayout.BeginHorizontal(); + GUILayout.Label("Engine ID", UIResources.GetStyle("data_header"), GUILayout.MaxWidth(160f)); + if (engineIDOptions != null && engineIDOptions.Length != 0) + { + engineIndex = GUILayout.SelectionGrid(engineIndex, engineIDOptions, 2); + } + else + { + GUILayout.Label("0"); + } + GUILayout.EndHorizontal(); + offOnFlameout = GUILayout.Toggle(offOnFlameout, "Zero on Flameout"); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Ramp Rate Up", UIResources.GetStyle("data_header"), GUILayout.MaxWidth(160f)); + rampStrings[0] = GUILayout.TextArea(rampStrings[0], GUILayout.MaxWidth(60f)); + + if (Single.TryParse(rampStrings[0], out float floatParsed)) + { + rampRateUp = floatParsed; + } + + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Ramp Rate Down", UIResources.GetStyle("data_header"), GUILayout.MaxWidth(160f)); + rampStrings[1] = GUILayout.TextArea(rampStrings[1], GUILayout.MaxWidth(60f)); + if (Single.TryParse(rampStrings[1], out floatParsed)) + { + rampRateDown = floatParsed; + } + + GUILayout.EndHorizontal(); + } + + protected override void LoadOptions(EngineOnOffController controller) + { + rampStrings[0] = controller.responseRateUp.ToString(); + rampStrings[1] = controller.responseRateDown.ToString(); + List engineOptions = controller.ParentModule.part.FindModulesImplementing(); + engineIDOptions = engineOptions.Select(x => x.engineID).ToArray(); + engineIndex = engineIDOptions.ToList().IndexOf(controller.engineID); + engineIndex = engineIndex == -1 ? 0 : engineIndex; + offOnFlameout = controller.zeroOnFlameout; + } + + public override void DefaultOptions(ModuleWaterfallFX parentModule) + { + List engineOptions = parentModule.part.FindModulesImplementing(); + engineIDOptions = engineOptions.Select(x => x.engineID).ToArray(); + engineIndex = 0; + offOnFlameout = true; + } + + protected override EngineOnOffController CreateControllerInternal() => + new() + { + engineID = engineIDOptions[engineIndex], + responseRateUp = rampRateUp, + responseRateDown = rampRateDown + }; + } +} \ No newline at end of file diff --git a/Source/Waterfall/UI/EffectControllersUI/ScalarControllerUIOptions.cs b/Source/Waterfall/UI/EffectControllersUI/ScalarControllerUIOptions.cs new file mode 100644 index 00000000..6dd8e833 --- /dev/null +++ b/Source/Waterfall/UI/EffectControllersUI/ScalarControllerUIOptions.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using UnityEngine; +using UniLinq; + +namespace Waterfall.UI.EffectControllersUI +{ + public class ScalarControllerUIOptions : DefaultEffectControllerUIOptions + { + private string[] scalarIDOptions; + private int scalarIndex; + + public ScalarControllerUIOptions() + { + } + + public override void DrawOptions() + { + GUILayout.BeginHorizontal(); + GUILayout.Label("Scalar Module ID", UIResources.GetStyle("data_header"), GUILayout.MaxWidth(160f)); + if (scalarIDOptions != null && scalarIDOptions.Length != 0) + { + scalarIndex = GUILayout.SelectionGrid(scalarIndex, scalarIDOptions, 2); + } + else + { + GUILayout.Label("0"); + } + GUILayout.EndHorizontal(); + } + + protected override void LoadOptions(ScalarModuleController controller) + { + List scalarOptions = controller.ParentModule.part.FindModulesImplementing(); + scalarIDOptions = scalarOptions.Select(x => x.ScalarModuleID).ToArray(); + scalarIndex = scalarIDOptions.ToList().IndexOf(controller.moduleID); + scalarIndex = scalarIndex == -1 ? 0 : scalarIndex; + } + + public override void DefaultOptions(ModuleWaterfallFX parentModule) + { + List scalarOptions = parentModule.part.FindModulesImplementing(); + scalarIDOptions = scalarOptions.Select(x => x.ScalarModuleID).ToArray(); + scalarIndex = 0; + } + + protected override ScalarModuleController CreateControllerInternal() => + new() + { + moduleID = scalarIDOptions[scalarIndex] + }; + } +} \ No newline at end of file diff --git a/Source/Waterfall/UI/UIAppToolbarWindow.cs b/Source/Waterfall/UI/UIAppToolbarWindow.cs index 071a129d..d7dc715a 100644 --- a/Source/Waterfall/UI/UIAppToolbarWindow.cs +++ b/Source/Waterfall/UI/UIAppToolbarWindow.cs @@ -34,8 +34,7 @@ void Awake() // Stock toolbar handling methods void OnDestroy() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: OnDestroy Fired"); + Utils.Log("[UI]: OnDestroy Fired", LogType.UI); // Remove the stock toolbar button GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); GameEvents.onGUIApplicationLauncherDestroyed.Remove(OnGUIAppLauncherDestroyed); @@ -51,8 +50,7 @@ void OnDestroy() } protected void OnToolbarButtonToggle() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: Toolbar Button Toggled"); + Utils.Log("[UI]: Toolbar Button Toggled", LogType.UI); UIBaseWindow.ToggleWindow(); stockToolbarButton.SetTexture(UIBaseWindow.showWindow ? activeTexture : inactiveTexture); } @@ -60,8 +58,7 @@ protected void OnToolbarButtonToggle() protected void OnGUIAppLauncherReady() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: App Launcher Ready"); + Utils.Log("[UI]: App Launcher Ready", LogType.UI); if (ApplicationLauncher.Ready && stockToolbarButton == null) { @@ -78,8 +75,7 @@ protected void OnGUIAppLauncherReady() protected void OnGUIAppLauncherDestroyed() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: App Launcher Destroyed"); + Utils.Log("[UI]: App Launcher Destroyed", LogType.UI); if (stockToolbarButton != null) { ApplicationLauncher.Instance.RemoveModApplication(stockToolbarButton); @@ -89,8 +85,7 @@ protected void OnGUIAppLauncherDestroyed() protected void onAppLaunchToggleOff() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: App Launcher Toggle Off"); + Utils.Log("[UI]: App Launcher Toggle Off", LogType.UI); stockToolbarButton.SetTexture(inactiveTexture); } diff --git a/Source/Waterfall/UI/UIBaseWindow.cs b/Source/Waterfall/UI/UIBaseWindow.cs index c46adc8a..f44239d8 100644 --- a/Source/Waterfall/UI/UIBaseWindow.cs +++ b/Source/Waterfall/UI/UIBaseWindow.cs @@ -7,13 +7,13 @@ public class UIBaseWindow : MonoBehaviour { // Control Vars public static bool showWindow; - public Rect windowPos = new(200f, 200f, 1000f, 400f); - protected bool initUI; + public Rect windowPos = new(200f, 200f, 1000f, 400f); + protected bool initUI; // Assets - private float scrollHeight = 0f; - private Vector2 scrollPosition = Vector2.zero; - protected int windowID = new Random(13123).Next(); + private float scrollHeight = 0f; + private Vector2 scrollPosition = Vector2.zero; + protected int windowID = new Random(13123).Next(); UnityEngine.UI.Image image; @@ -25,8 +25,7 @@ public Rect WindowPosition protected virtual void Awake() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: Awake fired"); + Utils.Log("[UI]: Awake fired", LogType.UI); gameObject.layer = 5; gameObject.AddComponent(); @@ -48,8 +47,7 @@ protected virtual void Awake() protected virtual void Start() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: Start fired"); + Utils.Log("[UI]: Start fired", LogType.UI); } protected virtual void OnGUI() @@ -70,8 +68,7 @@ protected virtual void OnGUI() /// public static void ToggleWindow() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: Toggle Window"); + Utils.Log("[UI]: Toggle Window", LogType.UI); showWindow = !showWindow; } @@ -80,9 +77,8 @@ public static void ToggleWindow() /// protected virtual void InitUI() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: Initializing"); - initUI = true; + Utils.Log("[UI]: Initializing", LogType.UI); + initUI = true; } /// @@ -97,7 +93,7 @@ protected virtual void Draw() if (showWindow) { //windowPos.height = Mathf.Min(scrollHeight + 50f, 96f * 3f + 50f); - windowPos = GUILayout.Window(windowID, windowPos, DrawWindow, new GUIContent(), + windowPos = GUILayout.Window(windowID, windowPos, DrawWindow, new GUIContent(), UIResources.GetStyle("window_main"), GUILayout.ExpandHeight(true)); } } diff --git a/Source/Waterfall/UI/UIPopupWindow.cs b/Source/Waterfall/UI/UIPopupWindow.cs index d58ddc05..ea76d4d5 100644 --- a/Source/Waterfall/UI/UIPopupWindow.cs +++ b/Source/Waterfall/UI/UIPopupWindow.cs @@ -9,19 +9,19 @@ public class UIPopupWindow // Control Vars protected bool showWindow; - protected int windowID = new Random(123123).Next(); + protected int windowID = new Random(123123).Next(); protected bool initUI; // Assets - private Vector2 scrollPosition = Vector2.zero; - private float scrollHeight = 0f; + private Vector2 scrollPosition = Vector2.zero; + private float scrollHeight = 0f; public UIPopupWindow(bool show) { windowID = new Random().Next(); - if (Settings.DebugUIMode) - Utils.Log("[UI]: Start fired"); + + Utils.Log("[UI]: Start fired", LogType.UI); showWindow = show; } @@ -51,8 +51,7 @@ public virtual void Draw() /// public void ToggleWindow() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: Toggle Window"); + Utils.Log("[UI]: Toggle Window", LogType.UI); showWindow = !showWindow; } @@ -66,9 +65,7 @@ public void SetWindowState(bool on) /// protected virtual void InitUI() { - if (Settings.DebugUIMode) - Utils.Log("[UI]: Initializing"); - + Utils.Log("[UI]: Initializing", LogType.UI); initUI = true; } diff --git a/Source/Waterfall/UI/UIResources.cs b/Source/Waterfall/UI/UIResources.cs index 0f49b3ac..d214b4ff 100644 --- a/Source/Waterfall/UI/UIResources.cs +++ b/Source/Waterfall/UI/UIResources.cs @@ -7,12 +7,12 @@ namespace Waterfall.UI public static class UIResources { private static Dictionary _iconList; - private static Dictionary _styleList; - private static Dictionary _colorList; + private static Dictionary _styleList; + private static Dictionary _colorList; private static Texture _generalIcons; - + /// /// Load all resources /// @@ -22,8 +22,7 @@ public static void InitalizeUIResources() CreateStyleList(); CreateColorList(); - if (Settings.DebugUIMode) - Utils.Log("[UI]: Loaded Assets"); + Utils.Log("[UI]: Loaded Assets", LogType.UI); } /// @@ -89,15 +88,15 @@ internal static Texture GetUITexture(string textureName) internal static void CreateIconList() { _generalIcons = GetUITexture("icon_general"); - _iconList = new(); + _iconList = new(); // Add the general icons - _iconList.Add("lightning", new(_generalIcons, 0.00f, 0.75f, 0.25f, 0.25f)); - _iconList.Add("fire", new(_generalIcons, 0.25f, 0.75f, 0.25f, 0.25f)); + _iconList.Add("lightning", new(_generalIcons, 0.00f, 0.75f, 0.25f, 0.25f)); + _iconList.Add("fire", new(_generalIcons, 0.25f, 0.75f, 0.25f, 0.25f)); _iconList.Add("thermometer", new(_generalIcons, 0.50f, 0.75f, 0.25f, 0.25f)); - _iconList.Add("timer", new(_generalIcons, 0.75f, 0.75f, 0.25f, 0.25f)); - _iconList.Add("battery", new(_generalIcons, 0.5f, 0.50f, 0.25f, 0.25f)); - _iconList.Add("cancel", new(_generalIcons, 0.75f, 0.00f, 0.25f, 0.25f)); + _iconList.Add("timer", new(_generalIcons, 0.75f, 0.75f, 0.25f, 0.25f)); + _iconList.Add("battery", new(_generalIcons, 0.5f, 0.50f, 0.25f, 0.25f)); + _iconList.Add("cancel", new(_generalIcons, 0.75f, 0.00f, 0.25f, 0.25f)); } /// @@ -111,13 +110,13 @@ internal static void CreateStyleList() // -- REGIONS -- // Window - draftStyle = new(HighLogic.Skin.window); + draftStyle = new(HighLogic.Skin.window); draftStyle.padding = new(draftStyle.padding.left, draftStyle.padding.right, 2, draftStyle.padding.bottom); _styleList.Add("window_main", new(draftStyle)); // Area Background - draftStyle = new(HighLogic.Skin.textArea); - draftStyle.active = draftStyle.hover = draftStyle.normal; + draftStyle = new(HighLogic.Skin.textArea); + draftStyle.active = draftStyle.hover = draftStyle.normal; draftStyle.padding = new(8, 8, 8, 8); _styleList.Add("block_background", new(draftStyle)); @@ -127,39 +126,39 @@ internal static void CreateStyleList() _styleList.Add("radio_text_button", new(draftStyle)); // Accept button - draftStyle = new(HighLogic.Skin.button); + draftStyle = new(HighLogic.Skin.button); draftStyle.normal.textColor = draftStyle.normal.textColor; _styleList.Add("button_accept", new(draftStyle)); // Cancel button - draftStyle = new(HighLogic.Skin.button); + draftStyle = new(HighLogic.Skin.button); draftStyle.normal.textColor = draftStyle.normal.textColor; _styleList.Add("button_cancel", new(draftStyle)); // Image overlaid button - draftStyle = new(HighLogic.Skin.button); + draftStyle = new(HighLogic.Skin.button); draftStyle.normal.textColor = draftStyle.normal.textColor; _styleList.Add("button_overlaid", new(draftStyle)); // Image overlaid button - draftStyle = new(HighLogic.Skin.toggle); + draftStyle = new(HighLogic.Skin.toggle); draftStyle.normal.textColor = draftStyle.normal.textColor; _styleList.Add("button_toggle", new(draftStyle)); // Reddish header button type - draftStyle = new(HighLogic.Skin.button); - draftStyle.fontSize = 14; + draftStyle = new(HighLogic.Skin.button); + draftStyle.fontSize = 14; draftStyle.alignment = TextAnchor.MiddleLeft; _styleList.Add("positive_button", new(draftStyle)); draftStyle.stretchWidth = true; // Blueish head button type - draftStyle = new(HighLogic.Skin.button); - draftStyle.fontSize = 14; + draftStyle = new(HighLogic.Skin.button); + draftStyle.fontSize = 14; draftStyle.alignment = TextAnchor.MiddleLeft; _styleList.Add("negative_button", new(draftStyle)); draftStyle.stretchWidth = true; // Blueish head button type - draftStyle = new(HighLogic.Skin.button); - draftStyle.fontSize = 14; - draftStyle.alignment = TextAnchor.MiddleLeft; + draftStyle = new(HighLogic.Skin.button); + draftStyle.fontSize = 14; + draftStyle.alignment = TextAnchor.MiddleLeft; draftStyle.padding.left = 3; _styleList.Add("category_header_button", new(draftStyle)); draftStyle.stretchWidth = true; @@ -167,79 +166,79 @@ internal static void CreateStyleList() // -- TEXT --- // Window Header - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontStyle = FontStyle.Bold; - draftStyle.alignment = TextAnchor.MiddleLeft; - draftStyle.fontSize = 18; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontStyle = FontStyle.Bold; + draftStyle.alignment = TextAnchor.MiddleLeft; + draftStyle.fontSize = 18; draftStyle.stretchWidth = true; _styleList.Add("window_header", new(draftStyle)); // Basic text - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 12; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 12; draftStyle.alignment = TextAnchor.MiddleLeft; _styleList.Add("text_basic", new(draftStyle)); // Category table left header - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 14; - draftStyle.fontStyle = FontStyle.Bold; - draftStyle.alignment = TextAnchor.MiddleCenter; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 14; + draftStyle.fontStyle = FontStyle.Bold; + draftStyle.alignment = TextAnchor.MiddleCenter; draftStyle.stretchWidth = true; _styleList.Add("panel_header_centered", new(draftStyle)); // Category table left header - draftStyle = new(HighLogic.Skin.label); + draftStyle = new(HighLogic.Skin.label); draftStyle.fontSize = 12; - draftStyle.fontStyle = FontStyle.Bold; - draftStyle.alignment = TextAnchor.MiddleLeft; + draftStyle.fontStyle = FontStyle.Bold; + draftStyle.alignment = TextAnchor.MiddleLeft; draftStyle.padding.left = 3; _styleList.Add("positive_category_header", new(draftStyle)); // Category table field right - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 14; - draftStyle.alignment = TextAnchor.MiddleRight; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 14; + draftStyle.alignment = TextAnchor.MiddleRight; draftStyle.padding.right = 5; _styleList.Add("positive_category_header_field", new(draftStyle)); // Category table left header - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 14; - draftStyle.fontStyle = FontStyle.Bold; - draftStyle.alignment = TextAnchor.MiddleLeft; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 14; + draftStyle.fontStyle = FontStyle.Bold; + draftStyle.alignment = TextAnchor.MiddleLeft; draftStyle.padding.left = 3; _styleList.Add("negative_category_header", new(draftStyle)); // Category table field right - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 14; - draftStyle.alignment = TextAnchor.MiddleRight; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 14; + draftStyle.alignment = TextAnchor.MiddleRight; draftStyle.padding.right = 5; _styleList.Add("negative_category_header_field", new(draftStyle)); // Category table left header - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 14; - draftStyle.fontStyle = FontStyle.Bold; - draftStyle.alignment = TextAnchor.MiddleLeft; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 14; + draftStyle.fontStyle = FontStyle.Bold; + draftStyle.alignment = TextAnchor.MiddleLeft; draftStyle.padding.left = 3; _styleList.Add("category_header", new(draftStyle)); // Category table field right - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 14; - draftStyle.alignment = TextAnchor.MiddleRight; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 14; + draftStyle.alignment = TextAnchor.MiddleRight; draftStyle.padding.right = 5; _styleList.Add("category_header_field", new(draftStyle)); // Data table left header - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 14; - draftStyle.fontStyle = FontStyle.Bold; - draftStyle.alignment = TextAnchor.MiddleLeft; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 14; + draftStyle.fontStyle = FontStyle.Bold; + draftStyle.alignment = TextAnchor.MiddleLeft; draftStyle.padding.left = 5; _styleList.Add("data_header", new(draftStyle)); @@ -247,7 +246,7 @@ internal static void CreateStyleList() _styleList.Add("data_comment", new(new(HighLogic.Skin.label) { - fontSize = 14, + fontSize = 14, fontStyle = FontStyle.Normal, alignment = TextAnchor.MiddleLeft, padding = @@ -257,15 +256,15 @@ internal static void CreateStyleList() })); // Data table field right - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 14; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 14; draftStyle.padding.right = 3; - draftStyle.alignment = TextAnchor.MiddleRight; + draftStyle.alignment = TextAnchor.MiddleRight; _styleList.Add("data_field", new(draftStyle)); // Data table field right - draftStyle = new(HighLogic.Skin.label); - draftStyle.fontSize = 16; + draftStyle = new(HighLogic.Skin.label); + draftStyle.fontSize = 16; draftStyle.alignment = TextAnchor.MiddleRight; _styleList.Add("data_field_large", new(draftStyle)); } @@ -274,10 +273,10 @@ internal static void CreateColorList() { _colorList = new(); - _colorList.Add("cancel_color", new(208f / 255f, 131f / 255f, 86f / 255f)); - _colorList.Add("accept_color", new(209f / 255f, 250f / 255f, 146f / 255f)); + _colorList.Add("cancel_color", new(208f / 255f, 131f / 255f, 86f / 255f)); + _colorList.Add("accept_color", new(209f / 255f, 250f / 255f, 146f / 255f)); _colorList.Add("capacitor_blue", new(134f / 255f, 197f / 255f, 239f / 255f)); - _colorList.Add("readout_green", new(203f / 255f, 238f / 255f, 115f / 255f)); + _colorList.Add("readout_green", new(203f / 255f, 238f / 255f, 115f / 255f)); } } @@ -285,12 +284,12 @@ internal static void CreateColorList() public class AtlasIcon { public Texture iconAtlas; - public Rect iconRect; + public Rect iconRect; public AtlasIcon(Texture theAtlas, float bl_x, float bl_y, float x_size, float y_size) { iconAtlas = theAtlas; - iconRect = new(bl_x, bl_y, x_size, y_size); + iconRect = new(bl_x, bl_y, x_size, y_size); } } } \ No newline at end of file diff --git a/Source/Waterfall/Waterfall.csproj b/Source/Waterfall/Waterfall.csproj index 9354a43b..34afcc31 100644 --- a/Source/Waterfall/Waterfall.csproj +++ b/Source/Waterfall/Waterfall.csproj @@ -4,8 +4,8 @@ $(MSBuildThisFileDirectory)../.. GameData/Waterfall/Plugins - - + + Debug @@ -57,6 +57,8 @@ + + @@ -122,7 +124,9 @@ + + diff --git a/changelog.txt b/changelog.txt index cb4b27c6..52d83209 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,14 @@ +v0.10.5 +------- +- Fix remap controller that was not working after fixes in 0.10.0 +- Add new Engine On/Off controller: returns 0 if an engine is off, 1 if on. +- Add new Scalar Module controller: returns state of an IScalarModule (e.g. ModuleAnimateGeneric, ModuleAnimateHeat, ModuleColorChanger, etc) +- Fix some additional ungated log calls + +v0.10.4 +------- +- Removed a few log messages that were not gated behind flags correctly + v0.10.3 ------- - Fixed an issue where certain effects would miss their first update (SEP, Tundra RCS blocks) and get stuck in a bad state diff --git a/readme.txt b/readme.txt index a5c12cbb..df3c89ac 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ ================ -Waterfall 0.10.3 +Waterfall 0.10.5 ================ Waterfall is a mod for Kerbal Space Program that provides a cool new way to create and drive engine effects for smooth rocket plumes. It has