Skip to content

Commit

Permalink
Update 1.3.0
Browse files Browse the repository at this point in the history
De-linqed and recompiled
  • Loading branch information
icedown committed Jul 19, 2017
1 parent c3c1162 commit 4d8dc4f
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 60 deletions.
Binary file added .vs/CactEye2/v15/.suo
Binary file not shown.
29 changes: 13 additions & 16 deletions CactEye2/CactEye2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,45 +48,42 @@
<Compile Include="TelescopeMenu.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Development\Kerbal Space Program Prerelease\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>G:\Development\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Development\Kerbal Space Program Prerelease\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<HintPath>G:\Development\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Assembly-UnityScript, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Development\Kerbal Space Program Prerelease\KSP_x64_Data\Managed\Assembly-UnityScript.dll</HintPath>
<HintPath>G:\Development\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-UnityScript.dll</HintPath>
</Reference>
<Reference Include="Assembly-UnityScript-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Development\Kerbal Space Program Prerelease\KSP_x64_Data\Managed\Assembly-UnityScript-firstpass.dll</HintPath>
<HintPath>G:\Development\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-UnityScript-firstpass.dll</HintPath>
</Reference>
<Reference Include="KSPAssets, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Development\Kerbal Space Program Prerelease\KSP_x64_Data\Managed\KSPAssets.dll</HintPath>
<HintPath>G:\Development\Kerbal Space Program\KSP_x64_Data\Managed\KSPAssets.dll</HintPath>
</Reference>
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Development\Kerbal Space Program Prerelease\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>G:\Development\Kerbal Space Program\KSP_x64_Data\Managed\System.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Development\Kerbal Space Program Prerelease\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
<HintPath>G:\Development\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityScript.Lang, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Development\Kerbal Space Program Prerelease\KSP_x64_Data\Managed\UnityScript.Lang.dll</HintPath>
<HintPath>G:\Development\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>"C:\Development\Tools\pdb2mdb\pdb2mdb.exe" "$(TargetFileName)"
xcopy /Y "$(TargetPath)" "$(SolutionDir)CactEyeOptics\GameData\CactEye\Plugins\"
xcopy /Y "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)CactEyeOptics\GameData\CactEye\Plugins\"
xcopy /Y "$(TargetDir)$(TargetName).dll.mdb" "$(SolutionDir)CactEyeOptics\GameData\CactEye\Plugins\"
<PostBuildEvent>xcopy /Y "$(TargetPath)" "$(SolutionDir)CactEyeOptics\GameData\CactEye\Plugins\"

</PostBuildEvent>
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions CactEye2/CactEye2.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ReferencePath>G:\Development\Kerbal Space Program\KSP_x64_Data\Managed\</ReferencePath>
</PropertyGroup>
</Project>
8 changes: 6 additions & 2 deletions CactEye2/CactEyeAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

Expand Down Expand Up @@ -153,7 +152,12 @@ public void Update()
}
}

CelestialBody[] bodyCheck = occultationExpTimes.Keys.ToArray();
CelestialBody[] bodyCheck = new CelestialBody[occultationExpTimes.Keys.Count];
int counter = 0;
foreach (KeyValuePair<CelestialBody, double> pair in occultationExpTimes)
{
bodyCheck[counter++] = pair.Key;
}
foreach (CelestialBody body in bodyCheck)
{
if (Planetarium.GetUniversalTime() > occultationExpTimes[body])
Expand Down
3 changes: 1 addition & 2 deletions CactEye2/CactEyeAsteroidProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

Expand Down Expand Up @@ -97,7 +96,7 @@ public override string DoScience(Vector3 TargetPosition, float scienceMultiplier
float SciencePoints = 0f;
ExperimentID = "CactEyeAsteroid";
ScienceExperiment AsteroidExperiment = ResearchAndDevelopment.GetExperiment(ExperimentID);
ScienceSubject AsteroidSubject = ResearchAndDevelopment.GetExperimentSubject(AsteroidExperiment, ExperimentSituations.InSpaceHigh, FlightGlobals.ActiveVessel.mainBody, "");
ScienceSubject AsteroidSubject = ResearchAndDevelopment.GetExperimentSubject(AsteroidExperiment, ExperimentSituations.InSpaceHigh, FlightGlobals.ActiveVessel.mainBody, "", "");

SciencePoints += AsteroidExperiment.baseValue * AsteroidExperiment.dataScale * maxScience;

Expand Down
1 change: 0 additions & 1 deletion CactEye2/CactEyeAsteroidSpawner.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

Expand Down
26 changes: 23 additions & 3 deletions CactEye2/CactEyeCamera.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using KSP.IO;
Expand Down Expand Up @@ -65,8 +64,29 @@ public CactEyeCamera(Transform Position)
{
CameraSetup(camName);
}

skyboxRenderers = (from Renderer r in (FindObjectsOfType(typeof(Renderer)) as IEnumerable<Renderer>) where (r.name == "XP" || r.name == "XN" || r.name == "YP" || r.name == "YN" || r.name == "ZP" || r.name == "ZN") select r).ToArray<Renderer>();
Renderer[] allRenderers = FindObjectsOfType<Renderer>();
List<Renderer> sbRenderers = new List<Renderer>();
for(int i = 0; i < allRenderers.Length; i++)
{
switch(allRenderers[i].name)
{
case "XP":
case "XN":
case "YP":
case "YN":
case "ZP":
case "ZN":
sbRenderers.Add(allRenderers[i]);
break;

default:
break;
}
}
skyboxRenderers = sbRenderers.ToArray();

//skyboxRenderers = (from Renderer r in (FindObjectsOfType(typeof(Renderer))) where (r.name == "XP" || r.name == "XN" || r.name == "YP" || r.name == "YN" || r.name == "ZP" || r.name == "ZN") select r).ToArray<Renderer>();

if (skyboxRenderers == null)
{
Debug.Log("CactEye 2: Logical Error: skyboxRenderers is null!");
Expand Down
5 changes: 2 additions & 3 deletions CactEye2/CactEyeProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using KSP.UI.Dialogs;
Expand Down Expand Up @@ -316,9 +315,9 @@ private void _onPageTransmit(ScienceData Data)
//Grab list of available antenneas
List<IScienceDataTransmitter> AvailableTransmitters = vessel.FindPartModulesImplementing<IScienceDataTransmitter>();

if (AvailableTransmitters.Count() > 0)
if (AvailableTransmitters.Count > 0)
{
AvailableTransmitters.First().TransmitData(new List<ScienceData>{ Data });
AvailableTransmitters[0].TransmitData(new List<ScienceData>{ Data });
}

ResetExperimentGUI();
Expand Down
3 changes: 1 addition & 2 deletions CactEye2/CactEyeWideField.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

Expand Down Expand Up @@ -101,7 +100,7 @@ public override string DoScience(Vector3 TargetPosition, float scienceMultiplier
try
{
WideFieldExperiment = ResearchAndDevelopment.GetExperiment(ExperimentID);
WideFieldSubject = ResearchAndDevelopment.GetExperimentSubject(WideFieldExperiment, ExperimentSituations.InSpaceHigh, Target, "VisualObservation" + Target.name);
WideFieldSubject = ResearchAndDevelopment.GetExperimentSubject(WideFieldExperiment, ExperimentSituations.InSpaceHigh, Target, "VisualObservation" + Target.name, "");
WideFieldSubject.title = "CactEye Visual Planetary Observation of " + Target.name;
SciencePoints = WideFieldExperiment.baseValue * WideFieldExperiment.dataScale * maxScience * scienceMultiplier;
if (CactEyeConfig.DebugMode)
Expand Down
37 changes: 22 additions & 15 deletions CactEye2/TelescopeMenu.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using KSP.UI.Dialogs;
Expand Down Expand Up @@ -191,7 +190,7 @@ private void MainGUI(int WindowID)

ControlRect = GUILayoutUtility.GetRect(300f, 20f);

if (Processors.Count<CactEyeProcessor>() > 1)
if (Processors.Count > 1)
{
//Previous button
if (GUI.Button(new Rect(433f, 72f, 32, 32), Back9Icon))
Expand Down Expand Up @@ -487,7 +486,7 @@ private void DrawProcessorControls()

//Got an off-by-one error in the list somewhere
//Previous/Next buttons
if (Processors.Count<CactEyeProcessor>() > 1)
if (Processors.Count > 1)
{
//Previous button
if (GUI.Button(new Rect(ScopeRect.xMin + ((0.5f * ScopeRect.width) - 72), ScopeRect.yMin + (ScopeRect.height - 48f), 32, 32), Back9Icon))
Expand Down Expand Up @@ -534,14 +533,22 @@ private void GetReactionWheels()
}
}

Debug.Log("CactEye 2: Found " + ReactionWheels.Count().ToString() + " Gyro units.");
Debug.Log("CactEye 2: Found " + ReactionWheels.Count.ToString() + " Gyro units.");

if (ReactionWheels.Count<CactEyeGyro>() > 0)
{
if (ReactionWheels.Count > 0)
{
GyroEnabled = true;
ReactionWheelPitchTorques = ReactionWheels.Select(CactEyeGyro => CactEyeGyro.PitchTorque).ToList();
ReactionWheelYawTorques = ReactionWheels.Select(CactEyeGyro => CactEyeGyro.YawTorque).ToList();
ReactionWheelRollTorques = ReactionWheels.Select(CactEyeGyro => CactEyeGyro.RollTorque).ToList();
ReactionWheelPitchTorques = new List<float>();
ReactionWheelRollTorques = new List<float>();
ReactionWheelYawTorques = new List<float>();

for (int i = 0; i < ReactionWheels.Count; i++)
{
ReactionWheelPitchTorques.Add(ReactionWheels[i].PitchTorque);
ReactionWheelRollTorques.Add(ReactionWheels[i].RollTorque);
ReactionWheelYawTorques.Add(ReactionWheels[i].YawTorque);
}

}
else
{
Expand Down Expand Up @@ -572,11 +579,11 @@ private void GetProcessors()
}
}

Debug.Log("CactEye 2: Found " + Processors.Count().ToString() + " Processors.");
Debug.Log("CactEye 2: Found " + Processors.Count.ToString() + " Processors.");

if (Processors.Count<CactEyeProcessor>() > 0)
if (Processors.Count > 0)
{
ActiveProcessor = Processors.First<CactEyeProcessor>();
ActiveProcessor = Processors[0];
CurrentProcessorIndex = 0;

//if (ActiveProcessor.GetProcessorType().Contains("Wide Field"))
Expand All @@ -596,7 +603,7 @@ private void GetProcessors()
private void SetTorgue()
{

for (int i = 0; i < ReactionWheels.Count(); i++)
for (int i = 0; i < ReactionWheels.Count; i++)
{
ReactionWheels[i].GyroSensitivity = GyroSensitivity;
}
Expand Down Expand Up @@ -631,7 +638,7 @@ private CactEyeProcessor GetNext(IEnumerable<CactEyeProcessor> list, CactEyeProc
Debug.Log("CactEye 2: Exception 6: Was not able to find the next processor, even though there is one.");
Debug.Log(e.ToString());

return Processors.FirstOrDefault();
return Processors[0];
}
}

Expand Down Expand Up @@ -659,7 +666,7 @@ private CactEyeProcessor GetPrevious(IEnumerable<CactEyeProcessor> list, CactEye
Debug.Log("CactEye 2: Exception #: Was not able to find the next processor, even though there is one.");
Debug.Log(e.ToString());

return Processors.FirstOrDefault();
return Processors[0];
}
}

Expand Down
Binary file added CactEyeOptics/CactEyeOptics1.3.0.13.zip
Binary file not shown.
16 changes: 8 additions & 8 deletions CactEyeOptics/GameData/CactEye/CactEyeTelescopes.version
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"NAME":"CactEye Telescopes",
"URL":"https://raw.githubusercontent.com/icedown/CactEye-2/master/CactEyeOptics/GameData/CactEye/CactEyeTelescopes.version",
"DOWNLOAD":"https://github.com/icedown/CactEye-2/releases/download/1.2.0.9/CactEyeOptics1.2.1.10.zip",
"DOWNLOAD":"https://github.com/icedown/CactEye-2/releases/download/1.3.0.13/CactEyeOptics1.3.0.13.zip",
"CHANGE_LOG_URL":"https://github.com/icedown/CactEye-2/releases",
"VERSION":
{
"MAJOR":1,
"MINOR":2,
"PATCH":1,
"BUILD":10
"MINOR":3,
"PATCH":0,
"BUILD":13
},
"KSP_VERSION":
{
"MAJOR":1,
"MINOR":2,
"PATCH":1
"MINOR":3,
"PATCH":0
},
"KSP_VERSION_MIN":
{
"MAJOR":1,
"MINOR":2,
"PATCH":1
"MINOR":3,
"PATCH":0
}
}
Binary file not shown.
Binary file not shown.
5 changes: 0 additions & 5 deletions CactEyeOptics/GameData/CactEye/Plugins/MiniAVC.xml

This file was deleted.

6 changes: 3 additions & 3 deletions Netkan/CactEyeTelescopes.netkan
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"spec_version": "1.2.1.10",
"spec_version": "1.3.0.13",
"$kref": "#/ckan/spacedock/629",
"license": "CC-BY-4.0",
"resources": {
Expand All @@ -10,6 +10,6 @@
"install" : [ { "file" : "CactEyeOptics/GameData/CactEye",
"install_to" : "GameData" } ],
"comment" : "CactEye telescopes feature a fully-functional science system, and are upgradeable/serviceable (primarily through Kerbal Inventory System). Orbital telescopes also now become fundamental to discovering asteroids."
"ksp_version_min" "1.2.1",
"ksp_version_max" "1.2.1",
"ksp_version_min" "1.3.0",
"ksp_version_max" "1.3.0",
}
Binary file added Releases/CactEyeOptics1.3.0.13.zip
Binary file not shown.

0 comments on commit 4d8dc4f

Please sign in to comment.