Skip to content

Commit

Permalink
Merge pull request duckytopia#6 from Raven45/master
Browse files Browse the repository at this point in the history
CactEye Compatibility Update
  • Loading branch information
MOARdV committed Dec 11, 2014
2 parents 7bdb50f + 87ae085 commit 68f4d10
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Source-Code/FlareDraw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace DistantObject
{
[KSPAddon(KSPAddon.Startup.Flight, false)]
class FlareDraw : MonoBehaviour
public class FlareDraw : MonoBehaviour
{
private static Dictionary<Vessel, GameObject> vesselMeshLookup = new Dictionary<Vessel, GameObject>();
private static Dictionary<GameObject, Vessel> meshVesselLookup = new Dictionary<GameObject, Vessel>();
Expand All @@ -25,6 +25,8 @@ class FlareDraw : MonoBehaviour
private static float atmosphereFactor = 1.0f;
private static float dimFactor = 1.0f;

private static bool ExternalControl = false;

private List<string> situations = new List<string>();

private string showNameString = null;
Expand Down Expand Up @@ -217,7 +219,11 @@ private static void CheckDraw(GameObject flareMesh, Vector3d position, Celestial
private void UpdateVar()
{
camPos = FlightCamera.fetch.mainCamera.transform.position;
camFOV = FlightCamera.fetch.mainCamera.fieldOfView;

if (!ExternalControl)
{
camFOV = FlightCamera.fetch.mainCamera.fieldOfView;
}

foreach (CelestialBody body in FlightGlobals.Bodies)
{
Expand Down Expand Up @@ -506,5 +512,18 @@ private System.Collections.IEnumerator StartUp()
}
}
}

public static void SetFOV(float FOV)
{
if (ExternalControl)
{
camFOV = FOV;
}
}

public static void SetExternalFOVControl(bool Control)
{
ExternalControl = Control;
}
}
}

0 comments on commit 68f4d10

Please sign in to comment.