Skip to content

Commit

Permalink
Merge pull request #24 from BobPalmer/DEVELOP
Browse files Browse the repository at this point in the history
1.1
  • Loading branch information
BobPalmer committed Mar 30, 2016
2 parents 8fa90b1 + cb23e19 commit ab04ba9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.4.0 - 2016.03.29
------------
Compatibility with KSP 1.1

0.3.2 - 2016.01.18
------------------
Fixed an issue with warp drive performance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
},
"VERSION":{
"MAJOR":0,
"MINOR":3,
"PATCH":2,
"MINOR":4,
"PATCH":0,
"BUILD":0
},
"KSP_VERSION":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
"MINOR":1,
"PATCH":0
},
"KSP_VERSION_MIN":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
"MINOR":1,
"PATCH":0
},
"KSP_VERSION_MAX":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
"MINOR":1,
"PATCH":0
}
}
Binary file not shown.
20 changes: 10 additions & 10 deletions Source/WarpEngine/WarpEngine/USI_ModuleWarpEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void ToggleBubbleGuide()
{
var gobj = FindEditorWarpBubble();
if (gobj != null)
gobj.renderer.enabled = !gobj.renderer.enabled;
gobj.GetComponent<Renderer>().enabled = !gobj.GetComponent<Renderer>().enabled;

}

Expand Down Expand Up @@ -203,20 +203,20 @@ private void SetPartState(bool stiffenJoints)
BreakingForce = vp.breakingForce,
BreakingTorque = vp.breakingTorque,
CrashTolerance = vp.crashTolerance,
Constraints = vp.rigidbody.constraints
Constraints = vp.GetComponent<Rigidbody>().constraints
});
vp.breakingForce = Mathf.Infinity;
vp.breakingTorque = Mathf.Infinity;
vp.crashTolerance = Mathf.Infinity;
}
vessel.rigidbody.constraints &= RigidbodyConstraints.FreezeRotation;
vessel.GetComponent<Rigidbody>().constraints &= RigidbodyConstraints.FreezeRotation;
}

else
{
print("Unstiffening");
//Stop vessel
vessel.rigidbody.AddTorque(-vessel.rigidbody.angularVelocity);
vessel.GetComponent<Rigidbody>().AddTorque(-vessel.GetComponent<Rigidbody>().angularVelocity);
//Reset part state
if (_shipParts != null)
{
Expand All @@ -225,14 +225,14 @@ private void SetPartState(bool stiffenJoints)
if (vessel.parts.Contains(sp.ShipPart))
{
print("[WARP] Relaxing " + sp.ShipPart.name);
sp.ShipPart.rigidbody.AddTorque(-sp.ShipPart.rigidbody.angularVelocity);
sp.ShipPart.GetComponent<Rigidbody>().AddTorque(-sp.ShipPart.GetComponent<Rigidbody>().angularVelocity);
sp.ShipPart.breakingForce = sp.BreakingForce;
sp.ShipPart.breakingTorque = sp.BreakingTorque;
sp.ShipPart.crashTolerance = sp.CrashTolerance;
sp.ShipPart.rigidbody.constraints = sp.Constraints;
sp.ShipPart.GetComponent<Rigidbody>().constraints = sp.Constraints;
}
}
vessel.rigidbody.constraints &= ~RigidbodyConstraints.FreezeRotation;
vessel.GetComponent<Rigidbody>().constraints &= ~RigidbodyConstraints.FreezeRotation;
}
}
}
Expand Down Expand Up @@ -443,7 +443,7 @@ private void PlayWarpAnimation(float speed)
//Set our color
var rgb = ColorUtils.HSL2RGB(Math.Abs(speed - 1), 0.5, speed / 2);
var c = new Color(rgb[0], rgb[1], rgb[2]);
warpBubble.renderer.material.SetColor("_Color", c);
warpBubble.GetComponent<Renderer>().material.SetColor("_Color", c);

}
catch (Exception)
Expand Down Expand Up @@ -490,7 +490,7 @@ private void CheckBubbleDeployment(int speed)
if (_state != StartState.Editor)
{
if (editorBubble != null)
editorBubble.renderer.enabled = false;
editorBubble.GetComponent<Renderer>().enabled = false;
}
}
catch (Exception)
Expand All @@ -502,7 +502,7 @@ private GameObject FindEditorWarpBubble()
{
foreach (var gobj in GameObject.FindObjectsOfType<GameObject>())
{
if (gobj.name == "EditorWarpBubble" && gobj.renderer != null)
if (gobj.name == "EditorWarpBubble" && gobj.GetComponent<Renderer>() != null)
return gobj;
}

Expand Down
8 changes: 8 additions & 0 deletions Source/WarpEngine/WarpEngine/WarpEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<HintPath>..\..\..\..\..\KSP_DEV\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="KSPUtil">
<HintPath>..\..\..\..\..\KSP_DEV\KSP_Data\Managed\KSPUtil.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
Expand All @@ -45,6 +49,10 @@
<HintPath>..\..\..\..\..\KSP_DEV\KSP_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\KSP_DEV\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ColorUtilities.cs" />
Expand Down

0 comments on commit ab04ba9

Please sign in to comment.