Skip to content

Commit

Permalink
Merge pull request #204 from DMagic1/dev
Browse files Browse the repository at this point in the history
SCANsat version 15.0
  • Loading branch information
DMagic1 committed Mar 30, 2016
2 parents e958a4e + 93c7382 commit 74ef284
Show file tree
Hide file tree
Showing 22 changed files with 182 additions and 56 deletions.
20 changes: 10 additions & 10 deletions SCANassets/SCANsat.version
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"NAME":"SCANsat",
"URL":"https://raw.githubusercontent.com/S-C-A-N/SCANsat/release/SCANassets/SCANsat.version",
"URL":"https://raw.githubusercontent.com/S-C-A-N/SCANsat/dev/SCANassets/SCANsat.version",
"DOWNLOAD":"https://github.com/S-C-A-N/SCANsat/releases",
"GITHUB":{
"USERNAME":"S-C-A-N",
"REPOSITORY":"SCANsat",
"ALLOW_PRE_RELEASE":false
"ALLOW_PRE_RELEASE":true
},
"VERSION":{
"MAJOR":1,
"MINOR":1,
"PATCH":4,
"BUILD":9
"PATCH":5,
"BUILD":0
},
"KSP_VERSION":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
"MINOR":1,
"PATCH":0
},
"KSP_VERSION_MIN":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
"MINOR":1,
"PATCH":0
},
"KSP_VERSION_MAX":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
"MINOR":1,
"PATCH":0
}
}
11 changes: 11 additions & 0 deletions SCANsat/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Version 15.0 - 2016-3-30
------------------------

- Update to KSP 1.1 and Unity 5

- Known issues
- Ground tracks don't function
- MechJeb integration removed
- SCANsat resource scanning requires Module Manager; it won't work without it and hasn't been tested in KSP 1.1


Version 14.9 - 2016-3-6
------------------------

Expand Down
8 changes: 4 additions & 4 deletions SCANsat/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.4.0.9")]
[assembly: AssemblyFileVersion ("1.4.0.9")]
[assembly: AssemblyInformationalVersion ("v14.9")]
[assembly: AssemblyVersion ("1.5.0.0")]
[assembly: AssemblyFileVersion ("1.5.0.0")]
[assembly: AssemblyInformationalVersion ("v15.0")]

[assembly: KSPAssembly ("SCANsat", 1, 4)]
[assembly: KSPAssembly ("SCANsat", 1, 5)]


2 changes: 1 addition & 1 deletion SCANsat/SCAN_Data/SCANdata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public List<SCANwaypoint> Waypoints

if (WaypointManager.Instance() != null)
{
var remaining = WaypointManager.Instance().AllWaypoints();
var remaining = WaypointManager.Instance().Waypoints;
for (int i = 0; i < remaining.Count; i++)
{
Waypoint p = remaining[i];
Expand Down
3 changes: 2 additions & 1 deletion SCANsat/SCAN_PartModules/SCANsat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using SCANsat.SCAN_Data;
using SCANsat.SCAN_Toolbar;
using SCANsat.SCAN_UI;
using KSP.UI.Screens.Flight.Dialogs;

using UnityEngine;
using palette = SCANsat.SCAN_UI.UI_Framework.SCANpalette;
Expand Down Expand Up @@ -581,7 +582,7 @@ public void ReviewData()
if (expDialog != null)
DestroyImmediate(expDialog);
ScienceData sd = storedData[0];
expDialog = ExperimentsResultDialog.DisplayResult(new ExperimentResultDialogPage(part, sd, 1f, 0f, false, "", true, false, DumpData, KeepData, TransmitData, null));
expDialog = ExperimentsResultDialog.DisplayResult(new ExperimentResultDialogPage(part, sd, 1f, 0f, false, "", true, new ScienceLabSearch(vessel, sd), DumpData, KeepData, TransmitData, null));
}

public bool IsRerunnable()
Expand Down
76 changes: 65 additions & 11 deletions SCANsat/SCAN_Platform/SCAN_MBW.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,50 @@ protected SCAN_MBW()
}
#endregion

protected override void Start()
{
base.Start();

GameEvents.onShowUI.Add(UIOn);
GameEvents.onHideUI.Add(UIOff);
GameEvents.onGUIMissionControlSpawn.Add(UIOff);
GameEvents.onGUIMissionControlDespawn.Add(UIOff);
GameEvents.onGUIRnDComplexSpawn.Add(UIOff);
GameEvents.onGUIRnDComplexDespawn.Add(UIOn);
GameEvents.onGUIAdministrationFacilitySpawn.Add(UIOff);
GameEvents.onGUIAdministrationFacilityDespawn.Add(UIOn);
GameEvents.onGUIAstronautComplexSpawn.Add(UIOff);
GameEvents.onGUIAstronautComplexDespawn.Add(UIOn);
}

protected override void OnDestroy()
{
base.OnDestroy();

GameEvents.onShowUI.Remove(UIOn);
GameEvents.onHideUI.Remove(UIOff);
GameEvents.onGUIMissionControlSpawn.Remove(UIOff);
GameEvents.onGUIMissionControlDespawn.Remove(UIOff);
GameEvents.onGUIRnDComplexSpawn.Remove(UIOff);
GameEvents.onGUIRnDComplexDespawn.Remove(UIOn);
GameEvents.onGUIAdministrationFacilitySpawn.Remove(UIOff);
GameEvents.onGUIAdministrationFacilityDespawn.Remove(UIOn);
GameEvents.onGUIAstronautComplexSpawn.Remove(UIOff);
GameEvents.onGUIAstronautComplexDespawn.Remove(UIOn);
}

private void UIOn()
{
showUI = true;
}

private void UIOff()
{
showUI = false;
}

private bool showUI = true;

internal Int32 WindowID { get; private set; }
internal TimeSpan DrawWindowInternalDuration { get; private set; }
private bool _Visible;
Expand Down Expand Up @@ -227,20 +271,30 @@ public bool Visible
get { return _Visible; }
set
{
if (_Visible != value)
{
if (value)
{
Log.Debug("Adding Window to PostDrawQueue-{0}", WindowID); RenderingManager.AddToPostDrawQueue(5, this.DrawGUI);
}
else
{
Log.Debug("Removing Window from PostDrawQueue", WindowID); RenderingManager.RemoveFromPostDrawQueue(5, this.DrawGUI);
}
}
//if (_Visible != value)
//{
// if (value)
// {
// Log.Debug("Adding Window to PostDrawQueue-{0}", WindowID); RenderingManager.AddToPostDrawQueue(5, this.DrawGUI);
// }
// else
// {
// Log.Debug("Removing Window from PostDrawQueue", WindowID); RenderingManager.RemoveFromPostDrawQueue(5, this.DrawGUI);
// }
//}
_Visible = value;
}
}
private void OnGUI()
{
if (!showUI)
return;

if (!_Visible)
return;

this.DrawGUI();
}
protected void DrawGUI()
{
string cc = "";
Expand Down
1 change: 1 addition & 0 deletions SCANsat/SCAN_Toolbar/SCANappLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using SCANsat.SCAN_Platform;
using SCANsat.SCAN_UI;
using SCANsat.SCAN_UI.UI_Framework;
using KSP.UI.Screens;

namespace SCANsat.SCAN_Toolbar
{
Expand Down
4 changes: 4 additions & 0 deletions SCANsat/SCAN_UI/SCANbigMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ protected override void Awake()

protected override void Start()
{
base.Start();

//Initialize the map object
Visible = SCANcontroller.controller.bigMapVisible;
WindowRect.x = SCANcontroller.controller.map_x;
Expand Down Expand Up @@ -115,6 +117,8 @@ private void initializeMap()

protected override void OnDestroy()
{
base.OnDestroy();

SCANcontroller.controller.unloadPQS(bigmap.Body, mapSource.BigMap);
}

Expand Down
4 changes: 4 additions & 0 deletions SCANsat/SCAN_UI/SCANcolorSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ protected override void Awake()

protected override void Start()
{
base.Start();

TooltipsEnabled = false;

if (SCANconfigLoader.languagePack != null)
Expand Down Expand Up @@ -219,6 +221,8 @@ private void loadStrings()

protected override void OnDestroy()
{
base.OnDestroy();

removeControlLocks();
TooltipsEnabled = false;
}
Expand Down
4 changes: 4 additions & 0 deletions SCANsat/SCAN_UI/SCANinstrumentUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ protected override void Awake()

protected override void Start()
{
base.Start();

GameEvents.onVesselSOIChanged.Add(soiChange);
GameEvents.onVesselChange.Add(vesselChange);
GameEvents.onVesselWasModified.Add(vesselChange);
Expand All @@ -84,6 +86,8 @@ protected override void Start()

protected override void OnDestroy()
{
base.OnDestroy();

GameEvents.onVesselSOIChanged.Remove(soiChange);
GameEvents.onVesselChange.Remove(vesselChange);
GameEvents.onVesselWasModified.Remove(vesselChange);
Expand Down
6 changes: 5 additions & 1 deletion SCANsat/SCAN_UI/SCANkscMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ protected override void Awake()

protected override void Start()
{
base.Start();

Visible = SCANcontroller.controller.kscMapVisible;
if (b == null)
b = Planetarium.fetch.Home;
Expand Down Expand Up @@ -95,6 +97,8 @@ protected override void Start()

protected override void OnDestroy()
{
base.OnDestroy();

removeControlLocks();
if (spotMap != null)
Destroy(spotMap);
Expand All @@ -112,7 +116,7 @@ protected override void Update()

MapObject target = PlanetariumCamera.fetch.target;

if (target.type != MapObject.MapObjectType.VESSEL)
if (target.type != MapObject.ObjectType.Vessel)
{
v = null;
return;
Expand Down
2 changes: 2 additions & 0 deletions SCANsat/SCAN_UI/SCANmainMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ protected override void Awake()

protected override void Start()
{
base.Start();

Visible = SCANcontroller.controller.mainMapVisible;
v = FlightGlobals.ActiveVessel;
data = SCANUtil.getData(v.mainBody);
Expand Down
4 changes: 4 additions & 0 deletions SCANsat/SCAN_UI/SCANoverlayController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ protected override void Awake()

protected override void Start()
{
base.Start();

GameEvents.onShowUI.Add(showUI);
GameEvents.onHideUI.Add(hideUI);
GameEvents.onGameSceneSwitchRequested.Add(switchScene);
Expand Down Expand Up @@ -107,6 +109,8 @@ private void switchScene(GameEvents.FromToAction<GameScenes, GameScenes> FT)

protected override void OnDestroy()
{
base.OnDestroy();

GameEvents.onShowUI.Remove(showUI);
GameEvents.onHideUI.Remove(hideUI);
GameEvents.onGameSceneSwitchRequested.Remove(switchScene);
Expand Down
2 changes: 2 additions & 0 deletions SCANsat/SCAN_UI/SCANresourceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ protected override void Awake()

protected override void Start()
{
base.Start();

oldNarrowBand = SCANcontroller.controller.needsNarrowBand;
oldStockScanThreshold = SCANcontroller.controller.useScanThreshold;
oldInstantScan = SCANcontroller.controller.easyModeScanning;
Expand Down
4 changes: 4 additions & 0 deletions SCANsat/SCAN_UI/SCANsettingsUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ protected override void Awake()

protected override void OnDestroy()
{
base.OnDestroy();

removeControlLocks();
TooltipsEnabled = false;
}
Expand All @@ -89,6 +91,8 @@ internal void removeControlLocks()

protected override void Start()
{
base.Start();

oldTooltips = SCANcontroller.controller.toolTips;
TooltipsEnabled = false;
stockToolbar = SCANcontroller.controller.useStockAppLauncher;
Expand Down
4 changes: 3 additions & 1 deletion SCANsat/SCAN_UI/SCANzoomWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ protected virtual void Startup()

protected override void OnDestroy()
{
base.OnDestroy();

removeControlLocks();

SCANcontroller.controller.unloadPQS(spotmap.Body, mapSource.ZoomMap);
Expand Down Expand Up @@ -383,7 +385,7 @@ protected override void Update()
{
MapObject target = PlanetariumCamera.fetch.target;

if (target.type == MapObject.MapObjectType.VESSEL)
if (target.type == MapObject.ObjectType.Vessel)
v = target.vessel;
else
v = null;
Expand Down
12 changes: 6 additions & 6 deletions SCANsat/SCAN_UI/UI_Framework/SCANskins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ private static void initializeSkins()
SCAN_skin = SCAN_SkinsLibrary.CopySkin("Unity");
SCAN_SkinsLibrary.AddSkin("SCAN_Unity", SCAN_skin);

ScreenMessages SM = (ScreenMessages)GameObject.FindObjectOfType(typeof(ScreenMessages));
dotty = SM.textStyles[1].font;
//ScreenMessages SM = (ScreenMessages)GameObject.FindObjectOfType(typeof(ScreenMessages));
//dotty = SM.textStyles[1].font;

SCAN_window = new GUIStyle(SCAN_SkinsLibrary.DefUnitySkin.window);
SCAN_window.name = "SCAN_Window";
Expand Down Expand Up @@ -304,7 +304,7 @@ private static void initializeSkins()
SCAN_anomalyOverlay = new GUIStyle(SCAN_SkinsLibrary.DefUnitySkin.label);
SCAN_anomalyOverlay.name = "SCAN_AnomalyOverlay";
SCAN_anomalyOverlay.font = dotty;
SCAN_anomalyOverlay.fontSize = 32;
SCAN_anomalyOverlay.fontSize = 20;
SCAN_anomalyOverlay.fontStyle = FontStyle.Bold;
SCAN_anomalyOverlay.normal.textColor = palette.cb_skyBlue;

Expand Down Expand Up @@ -335,7 +335,7 @@ private static void initializeSkins()
SCAN_headline.name = "SCAN_Headline";
SCAN_headline.normal.textColor = palette.xkcd_YellowGreen;
SCAN_headline.alignment = TextAnchor.MiddleCenter;
SCAN_headline.fontSize = 30;
SCAN_headline.fontSize = 20;
SCAN_headline.font = dotty;

SCAN_headerButton = new GUIStyle(SCAN_SkinsLibrary.DefUnitySkin.button);
Expand All @@ -348,7 +348,7 @@ private static void initializeSkins()

SCAN_headlineSmall = new GUIStyle(SCAN_headline);
SCAN_headlineSmall.name = "SCAN_HeadlineSmall";
SCAN_headlineSmall.fontSize = 30;
SCAN_headlineSmall.fontSize = 16;

SCAN_labelSmallLeft = new GUIStyle(SCAN_whiteReadoutLabel);
SCAN_labelSmallLeft.name = "SCAN_LabelSmallLeft";
Expand All @@ -369,7 +369,7 @@ private static void initializeSkins()
SCAN_toggle.name = "SCAN_Toggle";
SCAN_toggle.font = dotty;
SCAN_toggle.onNormal.textColor = palette.xkcd_YellowGreen;
SCAN_toggle.fontSize = 30;
SCAN_toggle.fontSize = 20;
SCAN_toggle.fixedHeight = 28;
SCAN_toggle.fixedWidth = 28;

Expand Down
Loading

0 comments on commit 74ef284

Please sign in to comment.