Skip to content

Commit

Permalink
Merge pull request #168 from DMagic1/release
Browse files Browse the repository at this point in the history
SCANsat v14.3
  • Loading branch information
DMagic1 committed Nov 10, 2015
2 parents 5034055 + be0a4ef commit 3b04f3f
Show file tree
Hide file tree
Showing 25 changed files with 737 additions and 240 deletions.
8 changes: 4 additions & 4 deletions SCANassets/SCANsat.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
"MAJOR":1,
"MINOR":1,
"PATCH":4,
"BUILD":2
"BUILD":3
},
"KSP_VERSION":{
"MAJOR":1,
"MINOR":0,
"PATCH":4
"PATCH":5
},
"KSP_VERSION_MIN":{
"MAJOR":1,
"MINOR":0,
"PATCH":2
"PATCH":5
},
"KSP_VERSION_MAX":{
"MAJOR":1,
"MINOR":0,
"PATCH":4
"PATCH":5
}
}
6 changes: 3 additions & 3 deletions SCANmechjeb/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.2")]
[assembly: AssemblyFileVersion("1.4.0.2")]
[assembly: AssemblyInformationalVersion ("v14.2")]
[assembly: AssemblyVersion("1.4.0.3")]
[assembly: AssemblyFileVersion("1.4.0.3")]
[assembly: AssemblyInformationalVersion ("v14.3")]

[assembly: KSPAssembly ("SCANmechjeb", 0, 3)]
[assembly: KSPAssemblyDependency ("SCANsat", 1, 4)]
Expand Down
22 changes: 22 additions & 0 deletions SCANsat/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
Version 14.3 - 2015-11-10
------------------------
- Update for KSP 1.0.5

- In-Game Help Function
- Help section for Settings window, Resource Settings window, and Color Selection window
- Activate help mode with the question mark button in the top right

- Localization project
- All help function strings are included in a config file
- Local translations can be added to this file to replace the English text

- Misc and Bug Fixes
- Fix bug while switching vessels from the small map vessel list
- Fix planetary overlay tooltips while in the tracking station
- Fix a potential loading error
- Fix bug generating terrain height maps on planets with PQS errors; prevents endless NRE spam
- Fix some problems with the background terrain height map generator
- Power usage works correctly up to 10000X time warp, instead of 1000X
- Remove debug log messages during planetary overlay map generation
- Change the default anomaly marker and close box icons to standard text

Version 14.2 - 2015-8-29
------------------------

Expand Down
6 changes: 3 additions & 3 deletions SCANsat/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
// 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.2")]
[assembly: AssemblyFileVersion ("1.4.0.2")]
[assembly: AssemblyInformationalVersion ("v14.2")]
[assembly: AssemblyVersion ("1.4.0.3")]
[assembly: AssemblyFileVersion ("1.4.0.3")]
[assembly: AssemblyInformationalVersion ("v14.3")]

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

Expand Down
54 changes: 42 additions & 12 deletions SCANsat/SCAN_Data/SCANdata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class SCANdata
private Int32[,] coverage;
private CelestialBody body;
private SCANterrainConfig terrainConfig;
private bool building, externalBuilding, built;
private bool mapBuilding, overlayBuilding, controllerBuilding, built;

private float[,] tempHeightMap;

Expand Down Expand Up @@ -96,6 +96,9 @@ public float HeightMapValue(int i, int lon, int lat, bool useTemp = false)
if (body.pqsController == null)
return 0;

if (heightMaps[i].Length < 10)
return 0;

return heightMaps[i][lon, lat];
}

Expand All @@ -116,16 +119,22 @@ public bool Disabled
internal set { disabled = value; }
}

public bool Building
public bool MapBuilding
{
get { return mapBuilding; }
internal set { mapBuilding = value; }
}

public bool OverlayBuilding
{
get { return building; }
internal set { building = value; }
get { return overlayBuilding; }
internal set { overlayBuilding = value; }
}

public bool ExternalBuilding
public bool ControllerBuilding
{
get { return externalBuilding; }
internal set { externalBuilding = value; }
get { return controllerBuilding; }
internal set { controllerBuilding = value; }
}

public bool Built
Expand Down Expand Up @@ -247,7 +256,7 @@ public List<SCANwaypoint> Waypoints
if (orbit == null)
continue;

if (orbit.targetBody == body)
if (orbit.TargetBody == body)
{
for (int j = 0; j < stationary[i].AllParameters.Count(); j++)
{
Expand Down Expand Up @@ -377,13 +386,33 @@ internal void generateHeightMap(ref int step, ref int xStart, int width)
if (body.pqsController == null)
{
built = true;
building = false;
externalBuilding = false;
mapBuilding = false;
overlayBuilding = false;
controllerBuilding = false;
if (!heightMaps.ContainsKey(body.flightGlobalsIndex))
heightMaps.Add(body.flightGlobalsIndex, new float[1, 1]);
return;
}

if (step <= 0)
{
try
{
double d = SCANUtil.getElevation(body, 0, 0);
}
catch (Exception e)
{
Debug.LogError("[SCANsat] Error In Detecting Terrain Height Map; Stopping Height Map Generator\n" + e);
built = true;
mapBuilding = false;
overlayBuilding = false;
controllerBuilding = false;
if (!heightMaps.ContainsKey(body.flightGlobalsIndex))
heightMaps.Add(body.flightGlobalsIndex, new float[1, 1]);
return;
}
}

if (tempHeightMap == null)
{
tempHeightMap = new float[360, 180];
Expand All @@ -394,8 +423,9 @@ internal void generateHeightMap(ref int step, ref int xStart, int width)
step = 0;
xStart = 0;
built = true;
building = false;
externalBuilding = false;
mapBuilding = false;
overlayBuilding = false;
controllerBuilding = false;
if (!heightMaps.ContainsKey(body.flightGlobalsIndex))
heightMaps.Add(body.flightGlobalsIndex, tempHeightMap);
tempHeightMap = null;
Expand Down
10 changes: 1 addition & 9 deletions SCANsat/SCAN_Data/SCANwaypoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SCANwaypoint
{
internal SCANwaypoint(SurveyWaypointParameter p)
{
way = reflectWaypoint(p);
way = p.wp;
if (way != null)
{
band = reflectFlightBand(p);
Expand Down Expand Up @@ -127,14 +127,6 @@ public bool LandingTarget
get { return landingTarget; }
}

private Waypoint reflectWaypoint(SurveyWaypointParameter p)
{
if (SCANmainMenuLoader.FinePrintWaypoint)
return SCANreflection.FinePrintWaypointObject(p);

return null;
}

private Waypoint reflectWaypoint(StationaryPointParameter p)
{
if (SCANmainMenuLoader.FinePrintStationaryWaypoint)
Expand Down
19 changes: 16 additions & 3 deletions SCANsat/SCAN_PartModules/SCANsat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ public override void OnUpdate()
Events["stopScan"].active = scanning;
if (sensorType != 32)
Fields["alt_indicator"].guiActive = scanning;
}

public override void OnFixedUpdate()
{
if (powerIsProblem)
{
addStatic();
Expand All @@ -130,9 +133,9 @@ public override void OnUpdate()
{
if (sensorType != 0 || SCANcontroller.controller.isVesselKnown(vessel.id, (SCANtype)sensorType))
{
if (TimeWarp.CurrentRate < 1500)
if (TimeWarp.CurrentRate < 15000)
{
float p = power * TimeWarp.deltaTime;
float p = power * TimeWarp.fixedDeltaTime;
float e = part.RequestResource("ElectricCharge", p);
if (e < p)
{
Expand All @@ -141,7 +144,6 @@ public override void OnUpdate()
}
else
{
registerScanner();
powerIsProblem = false;
}
}
Expand All @@ -153,6 +155,7 @@ public override void OnUpdate()
}
else
unregisterScanner();

alt_indicator = scanAlt();
}
}
Expand Down Expand Up @@ -522,6 +525,16 @@ public ScienceData[] GetData()
return storedData.ToArray();
}

public void ReturnData(ScienceData data)
{
if (data == null)
return;

storedData.Clear();

storedData.Add(data);
}

private void KeepData(ScienceData data)
{
expDialog = null;
Expand Down
25 changes: 25 additions & 0 deletions SCANsat/SCAN_Platform/SCAN_ConfigNodeStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,31 @@ public bool Load(string fileFullName)
}
}

public bool LoadSavedCopy()
{
try
{
Log.Debug("Loading ConfigNode");
if (FileExists)
{
ConfigNode cnToLoad = ConfigNode.Load(FilePath);
ConfigNode cnUnwrapped = cnToLoad.GetNode(this.GetType().Name);
ConfigNode.LoadObjectFromConfig(this, cnUnwrapped);
return true;
}
else
{
Log.Now("File could not be found to load after saving new copy ({0})", FilePath);
return false;
}
}
catch (Exception ex)
{
Log.Now("Failed to Load ConfigNode from file after saving ({0}) - Error:{1}", FilePath, ex.Message);
return false;
}
}

public bool Save()
{
Log.Debug("Saving ConfigNode");
Expand Down
2 changes: 1 addition & 1 deletion SCANsat/SCAN_Platform/SCAN_MBW.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public Rect GetWindowRect
private Rect _TooltipPosition = new Rect();

public bool TooltipsEnabled = false;
internal Int32 TooltipDisplayForSecs = 15;
protected Int32 TooltipDisplayForSecs = 15;
protected Int32 TooltipMaxWidth = 250;
private string strToolTipText = "";
private string strLastTooltipText = "";
Expand Down
Loading

0 comments on commit 3b04f3f

Please sign in to comment.