Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CactEye2/CactEye2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_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>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="KSPAssets">
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPAssets.dll</HintPath>
</Reference>
<Reference Include="KSPCore">
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPCore.dll</HintPath>
</Reference>
<Reference Include="KSPUtil">
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPUtil.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -45,6 +58,12 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Vectrosity">
<HintPath>..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Vectrosity.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CactEyeAsteroidProcessor.cs" />
Expand Down
11 changes: 7 additions & 4 deletions CactEye2/CactEyeConfigMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using UnityEngine;
using KSP.UI.Screens;

namespace CactEye2
{
Expand Down Expand Up @@ -188,8 +189,6 @@ public void Toggle()
SunDamage = CactEyeConfig.SunDamage;
GyroDecay = CactEyeConfig.GyroDecay;

RenderingManager.AddToPostDrawQueue(3, new Callback(DrawGUI));

if (CactEyeConfig.DebugMode)
{
Debug.Log("CactEye 2: Debug: CactEyeConfigMenu enabled!");
Expand All @@ -204,8 +203,6 @@ public void Toggle()
CactEyeConfig.GyroDecay = GyroDecay;
CactEyeConfig.ApplySettings();

RenderingManager.RemoveFromPostDrawQueue(3, new Callback(DrawGUI));

if (CactEyeConfig.DebugMode)
{
Debug.Log("CactEye 2: Debug: CactEyeConfigMenu disabled!");
Expand Down Expand Up @@ -256,6 +253,12 @@ private void MainGUI(int WindowID)
GUI.DragWindow(new Rect(0, 0, WindowPosition.width, 16));
}

public void OnGUI()
{
if (IsGUIVisible)
DrawGUI();
}

/* ************************************************************************************************
* Function Name: DrawGUI
* Input: N/A
Expand Down
6 changes: 6 additions & 0 deletions CactEye2/CactEyeOptics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ public void ToggleGUI()
}
}

public void OnGUI()
{
if (TelescopeControlMenu.IsGUIVisible)
TelescopeControlMenu.DrawGUI();
}

/* ************************************************************************************************
* Function Name: FixScope
* Input: None
Expand Down
18 changes: 10 additions & 8 deletions CactEye2/CactEyeProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
using System.Linq;
using System.Text;
using UnityEngine;
using KSP.UI.Dialogs;
using KSP.UI.Screens;
using KSP.UI.Screens.Flight.Dialogs;

namespace CactEye2
{
Expand Down Expand Up @@ -361,7 +364,7 @@ public System.Collections.IEnumerator ReviewDataCoroutine(ScienceData Data, Text
false, //bool for show transmit warning
"", //string for transmit warning
false, //show the reset button
false, //show the lab option
new ScienceLabSearch(this.part.vessel, Data),//show the lab option
new Callback<ScienceData>(_onPageDiscard),
new Callback<ScienceData>(_onPageKeep),
new Callback<ScienceData>(_onPageTransmit),
Expand All @@ -372,23 +375,22 @@ public System.Collections.IEnumerator ReviewDataCoroutine(ScienceData Data, Text
ExperimentsResultDialog ScienceDialog = ExperimentsResultDialog.DisplayResult(page);

//Store the old dialog gui information
ProgressStyle = ScienceDialog.guiSkin.customStyles.Where(n => n.name == "progressBarFill2").First();
GUIStyle style = ScienceDialog.guiSkin.box;
StyleDefault = style.normal;
SkinStored = ScienceDialog.guiSkin;
// ProgressStyle = ScienceDialog.guiSkin.customStyles.Where(n => n.name == "progressBarFill2").First();
// GUIStyle style = ScienceDialog.guiSkin.box;
// StyleDefault = style.normal;
// SkinStored = ScienceDialog.guiSkin;

////Lets put a pretty picture on the science dialog.
ScienceStyle = ScienceDialog.guiSkin.box;
// ScienceStyle = ScienceDialog.guiSkin.box;
ScienceStyle.normal.background = Screenshot;

ScienceDialog.guiSkin.window.fixedWidth = 587f;
// ScienceDialog.guiSkin.window.fixedWidth = 587f;
ScienceStyle.fixedWidth = 512f;
ScienceStyle.fixedHeight = 288f;


}


private void ResetExperimentGUI()
{
//print("Resetting GUI...");
Expand Down
13 changes: 3 additions & 10 deletions CactEye2/TelescopeMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using UnityEngine;
using KSP.UI.Dialogs;

namespace CactEye2
{
Expand All @@ -17,7 +18,7 @@ class TelescopeMenu: MonoBehaviour
private string WindowTitle;

//Flag that detects if the GUI is enabled or not.
private bool IsGUIVisible = false;
public bool IsGUIVisible = false;

//Gui is 80% of screen resolution.
private float ScreenToGUIRatio = 0.8f;
Expand Down Expand Up @@ -56,10 +57,6 @@ class TelescopeMenu: MonoBehaviour
static private double timer = 6f;
private double storedTime = 0f;

//Check for pause menu
//private bool GameIsPaused = false;


public TelescopeMenu(Transform Position)
{

Expand Down Expand Up @@ -122,8 +119,6 @@ public void Toggle()
Debug.Log("CactEye 2: Exception 3: Was not able to get a list of Reaction Wheels or Processors.");
Debug.Log(E.ToString());
}

RenderingManager.AddToPostDrawQueue(3, new Callback(DrawGUI));
}

else
Expand All @@ -136,8 +131,6 @@ public void Toggle()
}
ActiveProcessor = null;
}

RenderingManager.RemoveFromPostDrawQueue(3, new Callback(DrawGUI));
}
IsGUIVisible = !IsGUIVisible;
}
Expand Down Expand Up @@ -243,7 +236,7 @@ private void MainGUI(int WindowID)
GUI.DragWindow(new Rect(0, 0, WindowPosition.width, 16));
}

private void DrawGUI()
public void DrawGUI()
{

try
Expand Down
Binary file modified CactEye2/bin/Debug/Assembly-CSharp-firstpass.dll
Binary file not shown.
Binary file modified CactEye2/bin/Debug/Assembly-CSharp.dll
Binary file not shown.
Binary file modified CactEye2/bin/Debug/CactEye2.dll
Binary file not shown.
Binary file modified CactEye2/bin/Debug/CactEye2.pdb
Binary file not shown.
Binary file modified CactEye2/bin/Debug/Mono.Security.dll
Binary file not shown.
Binary file modified CactEye2/bin/Debug/UnityEngine.dll
Binary file not shown.
Loading