Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCANsat v14.3 #168

Merged
merged 36 commits into from
Nov 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ef56b03
Fix overlay tooltips in the tracking station
DMagic1 Oct 16, 2015
b3c4255
version
DMagic1 Oct 16, 2015
dd32b56
Test map generator algorithm before the first iteration
DMagic1 Oct 16, 2015
7e31f19
Fix NRE when switching vessels from the small map
DMagic1 Oct 16, 2015
60532ad
Error handling for vessel registration
DMagic1 Oct 16, 2015
52b38b7
Fix error logs; try to destroy overlay when switching scenes - doesn'…
DMagic1 Oct 16, 2015
cf557d4
load new localization file
DMagic1 Oct 16, 2015
ce0d4a3
Move power usage to physics update
DMagic1 Oct 16, 2015
073771f
New language pack classes
DMagic1 Oct 16, 2015
04c012b
help mode for settings window
DMagic1 Oct 16, 2015
b9add49
New files
DMagic1 Oct 18, 2015
cb3eaec
Add help tooltips to these objects
DMagic1 Oct 18, 2015
56c8617
Create a new localization file if one isn't found
DMagic1 Oct 18, 2015
b20b275
Add help mode to each of these windows
DMagic1 Oct 18, 2015
98c99b2
Access modifier
DMagic1 Oct 18, 2015
6701689
First pass at all help tooltips
DMagic1 Oct 18, 2015
30dd9c2
Changes
DMagic1 Oct 18, 2015
310b72e
Typos and editing
DMagic1 Oct 20, 2015
ad6ea0a
Don't use new lines
DMagic1 Oct 24, 2015
d241d11
Name change; fix loading
DMagic1 Oct 24, 2015
d1438fb
localization file name change
DMagic1 Oct 24, 2015
4b2d3ed
Wider tooltip windows
DMagic1 Oct 24, 2015
452bc08
Fixes for background terrain map generator
DMagic1 Oct 24, 2015
5ce9d1d
Fix power usage; works up to 10000X time warp
DMagic1 Oct 24, 2015
7796848
changes
DMagic1 Oct 24, 2015
2b9b8ef
New install location...
DMagic1 Nov 9, 2015
4f30cf1
New method for loading config directly from the file
DMagic1 Nov 9, 2015
4a12578
Load the newly created config file directly from the disk
DMagic1 Nov 9, 2015
55a55bf
Regex to handle new lines and string formats
DMagic1 Nov 9, 2015
18bee5a
Handle new partial transmission return
DMagic1 Nov 9, 2015
7ee611a
Survey waypoint field no longer private; adjust flightband reflection
DMagic1 Nov 9, 2015
da29e6e
Field name change for specific orbit target body
DMagic1 Nov 9, 2015
fb254cc
Update for KSP 1.0.5
DMagic1 Nov 9, 2015
89c3b87
for KSP 1.0.5
DMagic1 Nov 10, 2015
3ecef57
Change the default anomaly and close box icons
DMagic1 Nov 10, 2015
be0a4ef
Last changes...
DMagic1 Nov 10, 2015
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
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