Skip to content

Commit 68f4d10

Browse files
committed
Merge pull request duckytopia#6 from Raven45/master
CactEye Compatibility Update
2 parents 7bdb50f + 87ae085 commit 68f4d10

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

Source-Code/FlareDraw.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace DistantObject
88
{
99
[KSPAddon(KSPAddon.Startup.Flight, false)]
10-
class FlareDraw : MonoBehaviour
10+
public class FlareDraw : MonoBehaviour
1111
{
1212
private static Dictionary<Vessel, GameObject> vesselMeshLookup = new Dictionary<Vessel, GameObject>();
1313
private static Dictionary<GameObject, Vessel> meshVesselLookup = new Dictionary<GameObject, Vessel>();
@@ -25,6 +25,8 @@ class FlareDraw : MonoBehaviour
2525
private static float atmosphereFactor = 1.0f;
2626
private static float dimFactor = 1.0f;
2727

28+
private static bool ExternalControl = false;
29+
2830
private List<string> situations = new List<string>();
2931

3032
private string showNameString = null;
@@ -217,7 +219,11 @@ private static void CheckDraw(GameObject flareMesh, Vector3d position, Celestial
217219
private void UpdateVar()
218220
{
219221
camPos = FlightCamera.fetch.mainCamera.transform.position;
220-
camFOV = FlightCamera.fetch.mainCamera.fieldOfView;
222+
223+
if (!ExternalControl)
224+
{
225+
camFOV = FlightCamera.fetch.mainCamera.fieldOfView;
226+
}
221227

222228
foreach (CelestialBody body in FlightGlobals.Bodies)
223229
{
@@ -506,5 +512,18 @@ private System.Collections.IEnumerator StartUp()
506512
}
507513
}
508514
}
515+
516+
public static void SetFOV(float FOV)
517+
{
518+
if (ExternalControl)
519+
{
520+
camFOV = FOV;
521+
}
522+
}
523+
524+
public static void SetExternalFOVControl(bool Control)
525+
{
526+
ExternalControl = Control;
527+
}
509528
}
510529
}

0 commit comments

Comments
 (0)