Skip to content

Commit

Permalink
Merge branch 'hotfix-0.7.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Majiir committed Aug 13, 2013
2 parents 739244e + 23acbb3 commit 711fe0a
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 25 deletions.
18 changes: 15 additions & 3 deletions Parts/kethane_1m_converter/part.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,28 @@ fuelCrossFeed = True
MODULE
{
name = KethaneConverter
Label = Rocket Fuel
InputRates
{
Kethane = 2.25
ElectricCharge = 6
}
OutputRatios
{
LiquidFuel = 0.99
Oxidizer = 0.99
LiquidFuel = 0.97
}
}

MODULE
{
name = KethaneConverter
InputRates
{
Kethane = 2.25
ElectricCharge = 6
}
OutputRatios
{
Oxidizer = 1.01
}
}

Expand Down
2 changes: 1 addition & 1 deletion Plugin/IExtractorAnimator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public enum ExtractorState
Retracting,
}

internal interface IExtractorAnimator
public interface IExtractorAnimator
{
ExtractorState CurrentState { get; }
void Deploy();
Expand Down
2 changes: 1 addition & 1 deletion Plugin/InstallChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class InstallChecker : MonoBehaviour
{
protected void Start()
{
var assemblies = AssemblyLoader.loadedAssemblies.Where(a => a.assembly == Assembly.GetExecutingAssembly()).Where(a => a.url != "Kethane/Plugins");
var assemblies = AssemblyLoader.loadedAssemblies.Where(a => a.assembly.GetName().Name == Assembly.GetExecutingAssembly().GetName().Name).Where(a => a.url != "Kethane/Plugins");
if (assemblies.Any())
{
var badPaths = assemblies.Select(a => a.path).Select(p => Uri.UnescapeDataString(new Uri(Path.GetFullPath(KSPUtil.ApplicationRootPath)).MakeRelativeUri(new Uri(p)).ToString().Replace('/', Path.DirectorySeparatorChar)));
Expand Down
1 change: 0 additions & 1 deletion Plugin/Kethane.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<Compile Include="KethaneDetectorAnimatorUnity.cs" />
<Compile Include="KethaneDrillAnimator.cs" />
<Compile Include="KethaneDrillAnimatorLegacy.cs" />
<Compile Include="KethaneExtractorAnimatorLanded.cs" />
<Compile Include="KethaneGenerator.cs" />
<Compile Include="KethaneKerbalBlender.cs" />
<Compile Include="KethaneController.cs" />
Expand Down
4 changes: 2 additions & 2 deletions Plugin/KethaneDetectorAnimatorUnity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public override void OnUpdate()
foreach (var state in deployStates)
{
state.normalizedTime = Mathf.Clamp01(state.normalizedTime);
state.speed = (IsDetecting ? 1 : -1) * PowerRatio;
state.speed = IsDetecting ? PowerRatio : -1;
}

foreach (var state in runningStates)
{
state.speed = IsDetecting ? 0 : PowerRatio;
state.speed = IsDetecting ? PowerRatio : 0;
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion Plugin/KethaneExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ public Resource(ConfigNode node)
}
}

private class DefaultExtractorAnimator : IExtractorAnimator
{
public ExtractorState CurrentState { get; private set; }
public void Deploy() { CurrentState = ExtractorState.Deployed; }
public void Retract() { CurrentState = ExtractorState.Retracted; }

public DefaultExtractorAnimator()
{
CurrentState = ExtractorState.Retracted;
}
}

private IExtractorAnimator animator;

private List<Resource> resources;
Expand Down Expand Up @@ -49,7 +61,7 @@ public Resource(ConfigNode node)
public override void OnStart(PartModule.StartState state)
{
this.part.force_activate();
animator = part.Modules.OfType<IExtractorAnimator>().Single();
animator = part.Modules.OfType<IExtractorAnimator>().SingleOrDefault() ?? new DefaultExtractorAnimator();

headTransform = this.part.FindModelTransform(HeadTransform);
tailTransform = this.part.FindModelTransform(TailTransform);
Expand Down
15 changes: 0 additions & 15 deletions Plugin/KethaneExtractorAnimatorLanded.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Plugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyInformationalVersion("0.7.6")]
[assembly: AssemblyInformationalVersion("0.7.7")]

0 comments on commit 711fe0a

Please sign in to comment.