diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e5eb681 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +################################################################################ +# This .gitignore file was automatically created by Microsoft(R) Visual Studio. +################################################################################ + +/BDAnimationModules/.vs/BDAnimationModules +/BDAnimationModules/obj +/BDAnimationModules/bin/Debug +/BDAnimationModules/bin/Release/Vectrosity.dll +/BDAnimationModules/bin/Release/UnityEngine.xml +/BDAnimationModules/bin/Release/UnityEngine.UI.dll +/BDAnimationModules/bin/Release/UnityEngine.dll +/BDAnimationModules/bin/Release/TrackIRUnity.dll +/BDAnimationModules/bin/Release/TDx.TDxInput.dll +/BDAnimationModules/bin/Release/SaveUpgradePipeline.Core.dll +/BDAnimationModules/bin/Release/Mono.Security.dll +/BDAnimationModules/bin/Release/Mono.Cecil.dll +/BDAnimationModules/bin/Release/KSPUtil.dll +/BDAnimationModules/bin/Release/KSPAssets.dll +/BDAnimationModules/bin/Release/Assembly-CSharp.dll +/BDAnimationModules/bin/Release/Assembly-CSharp-firstpass.dll diff --git a/BDAnimationModules/BDAdjustableLandingGear.cs b/BDAnimationModules/BDAdjustableLandingGear.cs index 699b306..d242bb1 100644 --- a/BDAnimationModules/BDAdjustableLandingGear.cs +++ b/BDAnimationModules/BDAdjustableLandingGear.cs @@ -481,12 +481,12 @@ public void Update() //part.mass = baseMass * Mathf.Pow(algScale, 2); } - public float GetModuleMass(float defaultMass) + public float GetModuleMass(float defaultMass, ModifierStagingSituation sit) { return (baseMass * Mathf.Pow(algScale, 3))-defaultMass; } - public float GetModuleCost(float defaultCost) + public float GetModuleCost(float defaultCost, ModifierStagingSituation sit) { return (defaultCost * Mathf.Pow(algScale, 2))-defaultCost; } @@ -1014,7 +1014,17 @@ void RefreshTweakables() steeringEnabled = false; } } - + + public ModifierChangeWhen GetModuleMassChangeWhen() + { + return ModifierChangeWhen.FIXED; + + } + + public ModifierChangeWhen GetModuleCostChangeWhen() + { + return ModifierChangeWhen.FIXED; + } } } diff --git a/BDAnimationModules/BDAnimationModules.csproj b/BDAnimationModules/BDAnimationModules.csproj index eeda82e..b4c6349 100644 --- a/BDAnimationModules/BDAnimationModules.csproj +++ b/BDAnimationModules/BDAnimationModules.csproj @@ -1,5 +1,5 @@ - - + + Debug x86 @@ -9,7 +9,28 @@ Library BDAnimationModules BDAnimationModules - v3.5 + v4.0 + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true True @@ -28,9 +49,24 @@ bin\Release prompt 4 - x86 + AnyCPU False + + true + bin\Debug\ + DEBUG; + full + AnyCPU + prompt + MinimumRecommendedRules.ruleset + + + bin\Release\ + AnyCPU + prompt + MinimumRecommendedRules.ruleset + @@ -55,13 +91,32 @@ - C:\Games\KSP 1.0.2 - Mod Dev\KSP_Data\Managed\Assembly-CSharp.dll + D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll + + + D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll + + + D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPAssets.dll + + + D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPUtil.dll - C:\Games\KSP 1.0.2 - Mod Dev\KSP_Data\Managed\UnityEngine.dll + D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll + + + D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll + + + D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Vectrosity.dll - + + False + .NET Framework 3.5 SP1 + true + \ No newline at end of file diff --git a/BDAnimationModules/BDAnimationModules.csproj.user b/BDAnimationModules/BDAnimationModules.csproj.user new file mode 100644 index 0000000..dea172c --- /dev/null +++ b/BDAnimationModules/BDAnimationModules.csproj.user @@ -0,0 +1,13 @@ + + + + + + + + + + en-US + false + + \ No newline at end of file diff --git a/BDAnimationModules/BDAnimationModules.sln b/BDAnimationModules/BDAnimationModules.sln index 4e58dc8..98b8c3a 100644 --- a/BDAnimationModules/BDAnimationModules.sln +++ b/BDAnimationModules/BDAnimationModules.sln @@ -1,19 +1,30 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.25123.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BDAnimationModules", "BDAnimationModules.csproj", "{08E5AD1C-68F5-488A-B90E-804E42C255EC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {08E5AD1C-68F5-488A-B90E-804E42C255EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08E5AD1C-68F5-488A-B90E-804E42C255EC}.Debug|Any CPU.Build.0 = Debug|Any CPU {08E5AD1C-68F5-488A-B90E-804E42C255EC}.Debug|x86.ActiveCfg = Debug|x86 {08E5AD1C-68F5-488A-B90E-804E42C255EC}.Debug|x86.Build.0 = Debug|x86 + {08E5AD1C-68F5-488A-B90E-804E42C255EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08E5AD1C-68F5-488A-B90E-804E42C255EC}.Release|Any CPU.Build.0 = Release|Any CPU {08E5AD1C-68F5-488A-B90E-804E42C255EC}.Release|x86.ActiveCfg = Release|x86 {08E5AD1C-68F5-488A-B90E-804E42C255EC}.Release|x86.Build.0 = Release|x86 EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution StartupItem = BDAnimationModules.csproj EndGlobalSection diff --git a/BDAnimationModules/FSwheel/FSBDparticleFX.cs b/BDAnimationModules/FSwheel/FSBDparticleFX.cs index bfbddcd..19aa6a7 100644 --- a/BDAnimationModules/FSwheel/FSBDparticleFX.cs +++ b/BDAnimationModules/FSwheel/FSBDparticleFX.cs @@ -50,7 +50,7 @@ public FSBDparticleFX(GameObject _gameObject, Texture2D _particleTexture) private void addComponents() { - pEmitter = (ParticleEmitter)gameObject.AddComponent("MeshParticleEmitter"); + pEmitter = (ParticleEmitter)gameObject.AddComponent(typeof(MeshParticleEmitter)); pRenderer = gameObject.AddComponent(); pAnimator = gameObject.AddComponent(); } @@ -95,7 +95,7 @@ public void updateFX() if (useLocalSpaceVelocityHack) { //float velMagnitude = parentObject.rigidbody.velocity.magnitude; - float fxSpeed = Vector3.Dot(gameObject.transform.forward, parentObject.rigidbody.velocity); + float fxSpeed = Vector3.Dot(gameObject.transform.forward, parentObject.GetComponent().velocity); if (fxSpeed > 0f) fxSpeed = 0; pEmitter.localVelocity = new Vector3(0f, 0f, 1f + (-fxSpeed * 0.1f)); diff --git a/BDAnimationModules/FSwheel/FSBDwheel.cs b/BDAnimationModules/FSwheel/FSBDwheel.cs index 0168ec9..d64a9f9 100644 --- a/BDAnimationModules/FSwheel/FSBDwheel.cs +++ b/BDAnimationModules/FSwheel/FSBDwheel.cs @@ -485,16 +485,16 @@ public void setBrakeLight(BrakeStatus status) switch (status) { case BrakeStatus.on: - brakeEmissiveObject.renderer.material.SetColor("_EmissiveColor", new Color(onEmissiveColor.x, onEmissiveColor.y, onEmissiveColor.z)); + brakeEmissiveObject.GetComponent().material.SetColor("_EmissiveColor", new Color(onEmissiveColor.x, onEmissiveColor.y, onEmissiveColor.z)); break; case BrakeStatus.off: - brakeEmissiveObject.renderer.material.SetColor("_EmissiveColor", new Color(offEmissiveColor.x, offEmissiveColor.y, offEmissiveColor.z)); + brakeEmissiveObject.GetComponent().material.SetColor("_EmissiveColor", new Color(offEmissiveColor.x, offEmissiveColor.y, offEmissiveColor.z)); break; case BrakeStatus.deploying: - brakeEmissiveObject.renderer.material.SetColor("_EmissiveColor", new Color(deployingEmissiveColor.x, deployingEmissiveColor.y, deployingEmissiveColor.z)); + brakeEmissiveObject.GetComponent().material.SetColor("_EmissiveColor", new Color(deployingEmissiveColor.x, deployingEmissiveColor.y, deployingEmissiveColor.z)); break; case BrakeStatus.disabled: - brakeEmissiveObject.renderer.material.SetColor("_EmissiveColor", new Color(disabledEmissiveColor.x, disabledEmissiveColor.y, disabledEmissiveColor.z)); + brakeEmissiveObject.GetComponent().material.SetColor("_EmissiveColor", new Color(disabledEmissiveColor.x, disabledEmissiveColor.y, disabledEmissiveColor.z)); break; } } @@ -990,7 +990,7 @@ private void updateMotors() if (reverseMotor) throttleInput *= -1; double resourceConsumed = (double)Mathf.Abs(resourceConsumptionRate * throttleInput) * (double)TimeWarp.deltaTime; - if (!CheatOptions.InfiniteFuel) + if (!CheatOptions.InfinitePropellant) { double receivedResource = base.part.RequestResource(resourceName, resourceConsumed); if (resourceConsumed > 0f) diff --git a/BDAnimationModules/MouseAimLight.cs b/BDAnimationModules/MouseAimLight.cs index 155eefe..07b5d57 100644 --- a/BDAnimationModules/MouseAimLight.cs +++ b/BDAnimationModules/MouseAimLight.cs @@ -92,7 +92,7 @@ public override void OnStart (PartModule.StartState state) deployStates = SetUpAnimation(deployAnimName, this.part); } - emissiveMatRef = part.FindModelTransform(emissiveObjectName).renderer.material; + emissiveMatRef = part.FindModelTransform(emissiveObjectName).GetComponent().material; spotLight = part.FindModelTransform(lightObjectName).GetComponent(); spotlightIntensity = spotLight.intensity; diff --git a/BDAnimationModules/SurfaceWalker.cs b/BDAnimationModules/SurfaceWalker.cs index b21431c..e1db59a 100644 --- a/BDAnimationModules/SurfaceWalker.cs +++ b/BDAnimationModules/SurfaceWalker.cs @@ -80,11 +80,12 @@ public void FixedUpdate() if(walkerEnabled && vessel!=null && vessel.loaded) { - if(vessel.checkLanded() && !vessel.rigidbody.isKinematic && feetAreDown) + var rigidbody = vessel.GetComponent(); + if(vessel.checkLanded() && !rigidbody.isKinematic && feetAreDown) { //stickyFeet - if(stickyFeet) vessel.rigidbody.AddForce(10 * -part.transform.up); + if(stickyFeet) rigidbody.AddForce(10 * -part.transform.up); forwardForce = Vector3.MoveTowards(forwardForce, -vessel.ctrlState.pitch * moveForce * Vector3.forward, moveForce * moveAccelFactor * Time.fixedDeltaTime); diff --git a/BDAnimationModules/bin/Release/BDAnimationModules.dll b/BDAnimationModules/bin/Release/BDAnimationModules.dll new file mode 100644 index 0000000..a9900b0 Binary files /dev/null and b/BDAnimationModules/bin/Release/BDAnimationModules.dll differ