Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
16 changes: 13 additions & 3 deletions BDAnimationModules/BDAdjustableLandingGear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -1014,7 +1014,17 @@ void RefreshTweakables()
steeringEnabled = false;
}
}


public ModifierChangeWhen GetModuleMassChangeWhen()
{
return ModifierChangeWhen.FIXED;

}

public ModifierChangeWhen GetModuleCostChangeWhen()
{
return ModifierChangeWhen.FIXED;
}
}
}

69 changes: 62 additions & 7 deletions BDAnimationModules/BDAnimationModules.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand All @@ -9,7 +9,28 @@
<OutputType>Library</OutputType>
<RootNamespace>BDAnimationModules</RootNamespace>
<AssemblyName>BDAnimationModules</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>True</DebugSymbols>
Expand All @@ -28,9 +49,24 @@
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ConsolePause>False</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Compile Include="AnimatedContainer.cs" />
Expand All @@ -55,13 +91,32 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>C:\Games\KSP 1.0.2 - Mod Dev\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="KSPAssets">
<HintPath>D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPAssets.dll</HintPath>
</Reference>
<Reference Include="KSPUtil">
<HintPath>D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPUtil.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>C:\Games\KSP 1.0.2 - Mod Dev\KSP_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Vectrosity">
<HintPath>D:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Vectrosity.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="FSwheel\" />
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions BDAnimationModules/BDAnimationModules.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
15 changes: 13 additions & 2 deletions BDAnimationModules/BDAnimationModules.sln
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions BDAnimationModules/FSwheel/FSBDparticleFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ParticleRenderer>();
pAnimator = gameObject.AddComponent<ParticleAnimator>();
}
Expand Down Expand Up @@ -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<Rigidbody>().velocity);
if (fxSpeed > 0f)
fxSpeed = 0;
pEmitter.localVelocity = new Vector3(0f, 0f, 1f + (-fxSpeed * 0.1f));
Expand Down
10 changes: 5 additions & 5 deletions BDAnimationModules/FSwheel/FSBDwheel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Renderer>().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<Renderer>().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<Renderer>().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<Renderer>().material.SetColor("_EmissiveColor", new Color(disabledEmissiveColor.x, disabledEmissiveColor.y, disabledEmissiveColor.z));
break;
}
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion BDAnimationModules/MouseAimLight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Renderer>().material;

spotLight = part.FindModelTransform(lightObjectName).GetComponent<Light>();
spotlightIntensity = spotLight.intensity;
Expand Down
5 changes: 3 additions & 2 deletions BDAnimationModules/SurfaceWalker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ public void FixedUpdate()

if(walkerEnabled && vessel!=null && vessel.loaded)
{
if(vessel.checkLanded() && !vessel.rigidbody.isKinematic && feetAreDown)
var rigidbody = vessel.GetComponent<Rigidbody>();
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);
Expand Down
Binary file not shown.