Skip to content

Commit

Permalink
Merge pull request #151 from DMagic1/dev
Browse files Browse the repository at this point in the history
Version 13.4
  • Loading branch information
DMagic1 committed Jul 4, 2015
2 parents 3c3a47b + 88c68d1 commit a910044
Show file tree
Hide file tree
Showing 20 changed files with 703 additions and 551 deletions.
333 changes: 207 additions & 126 deletions README.md

Large diffs are not rendered by default.

136 changes: 76 additions & 60 deletions SCANassets/MM_Parts/SCANsat_Resource_Scanner.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{
name = SCANresourceDisplay
sensorType = 256
ScannerType = 0
ResourceName = Ore
}
}
Expand All @@ -15,73 +14,16 @@
{
name = SCANresourceDisplay
sensorType = 262144
ScannerType = 0
ResourceName = Karbonite
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[MetallicOre],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 128
ScannerType = 0
ResourceName = MetallicOre
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[Minerals],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 32768
ScannerType = 0
ResourceName = Minerals
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[Substrate],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 65536
ScannerType = 0
ResourceName = Substrate
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[Uraninite],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 1024
ScannerType = 0
ResourceName = Uraninite
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[Water],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 8192
ScannerType = 0
ResourceName = Water
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[He-3],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[He3]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 512
ScannerType = 0
ResourceName = He-3
}
}
Expand Down Expand Up @@ -139,7 +81,81 @@
best_alt = 150000
scanName = Resource Scan
power = 0.4
}
}

MODULE
{
name = SCANresourceDisplay
sensorType = 128
ResourceName = MetallicOre
}

MODULE
{
name = SCANresourceDisplay
sensorType = 32768
ResourceName = Minerals
}

MODULE
{
name = SCANresourceDisplay
sensorType = 65536
ResourceName = Substrate
}

MODULE
{
name = SCANresourceDisplay
sensorType = 1024
ResourceName = Uraninite
}

MODULE
{
name = SCANresourceDisplay
sensorType = 8192
ResourceName = Water
}
}

@PART[MKS_ScanOMatic]:FOR[SCANsat]:NEEDS[KolonyTools]
{

MODULE
{
name = SCANresourceDisplay
sensorType = 128
ResourceName = MetallicOre
}

MODULE
{
name = SCANresourceDisplay
sensorType = 32768
ResourceName = Minerals
}

MODULE
{
name = SCANresourceDisplay
sensorType = 65536
ResourceName = Substrate
}

MODULE
{
name = SCANresourceDisplay
sensorType = 1024
ResourceName = Uraninite
}

MODULE
{
name = SCANresourceDisplay
sensorType = 8192
ResourceName = Water
}
}

@PART[KA_DetectionArray_01]:FOR[SCANsat]:NEEDS[Karbonite]
Expand All @@ -154,5 +170,5 @@
best_alt = 150000
scanName = Karbonite Scan
power = 0.4
}
}
}
2 changes: 1 addition & 1 deletion SCANassets/SCANsat.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"MAJOR":1,
"MINOR":1,
"PATCH":3,
"BUILD":3
"BUILD":4
},
"KSP_VERSION":{
"MAJOR":1,
Expand Down
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.3.3.0")]
[assembly: AssemblyFileVersion("1.3.3.0")]
[assembly: AssemblyInformationalVersion ("v13.3")]
[assembly: AssemblyVersion("1.3.4.0")]
[assembly: AssemblyFileVersion("1.3.4.0")]
[assembly: AssemblyInformationalVersion ("v13.4")]

[assembly: KSPAssembly ("SCANmechjeb", 0, 3)]
[assembly: KSPAssemblyDependency ("SCANsat", 1, 3)]
Expand Down
16 changes: 16 additions & 0 deletions SCANsat/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Version 13.4 - 2015-7-3
------------------------

- Add ground track display for scanning vessels while in map mode
- Scanning width is displayed for the widest FOV
- Width is only accurate at the equator

- Fix SCAN Hi Def camera when used near the poles
- Fix bug allowing scanners to continue scanning without power
- Fix a bug with scanning near the poles
- Fix a bug causing duplicate grid lines to be drawn on the space center map
- Fix adding SCANsat resource abundance display module to parts that require multiple modules
- Stop animations when they reach their endpoints - may prevent FAR from getting stuck recalculating the vessel surface
- Slower update for planetary overlay tooltips; makes them easier to read
- Various UI tweaks and improvements to internal UI code

Version 13.3 - 2015-6-28
------------------------

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.3.3.0")]
[assembly: AssemblyFileVersion ("1.3.3.0")]
[assembly: AssemblyInformationalVersion ("v13.3")]
[assembly: AssemblyVersion ("1.3.4.0")]
[assembly: AssemblyFileVersion ("1.3.4.0")]
[assembly: AssemblyInformationalVersion ("v13.4")]

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

Expand Down
39 changes: 2 additions & 37 deletions SCANsat/SCAN_Map/SCANmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ internal void exportPNG()
System.IO.File.WriteAllBytes(fullPath, map.EncodeToPNG());

ScreenMessages.PostScreenMessage("Map saved: GameData/SCANsat/PluginData/" + filename, 8, ScreenMessageStyle.UPPER_CENTER);

SCANUtil.SCANdebugLog("Map of [{0}] saved\nMap Size: {1} X {2}\nMinimum Altitude: {3:F0}m; Maximum Altitude: {4:F0}m\nPixel Width At Equator: {5:F6}m", body.theName, map.width, map.height, data.TerrainConfig.MinTerrain, data.TerrainConfig.MaxTerrain, (body.Radius * 2 * Math.PI) / (map.width * 1f));
}

#endregion
Expand Down Expand Up @@ -596,7 +598,6 @@ internal Texture2D getPartialMap()
else
{
SCANuiUtil.generateResourceCache(ref resourceCache, resourceMapHeight, resourceMapWidth, resourceInterpolation, resourceMapScale, this);
//generateResourceCache();
mapstep++;
return map;
}
Expand Down Expand Up @@ -879,42 +880,6 @@ private float terrainElevation(double Lon, double Lat, SCANdata Data, out int Sc
return elevation;
}

//private void generateResourceCache()
//{
// for (int j = 0; j < resourceMapHeight; j += resourceInterpolation)
// {
// for (int i = 0; i < resourceMapWidth; i += resourceInterpolation)
// {
// Vector2d coords;
// if (zoom && projection == MapProjection.Polar)
// {
// double rLon = (i * 1.0f / resourceMapScale) - 180f + lon_offset;
// double rLat = (j * 1.0f / resourceMapScale) - 90f + lat_offset;

// double la = rLat, lo = rLon;
// rLat = unprojectLatitude(lo, la);
// rLon = unprojectLongitude(lo, la);

// if (double.IsNaN(rLat) || double.IsNaN(rLon) || rLat < -90 || rLat > 90 || rLon < -180 || rLon > 180)
// {
// resourceCache[i, j] = 0;
// continue;
// }

// coords = new Vector2d(rLon, rLat);
// }
// else
// {
// double rLon = SCANUtil.fixLonShift((i * 1.0f / resourceMapScale) - 180f + lon_offset);
// double rLat = (j * 1.0f / resourceMapScale) - 90f + lat_offset;
// coords = SCANUtil.fixRetardCoordinates(new Vector2d(rLon, rLat));
// }

// resourceCache[i, j] = SCANUtil.ResourceOverlay(coords.y, coords.x, resource.Name, body, SCANcontroller.controller.resourceBiomeLock) * 100f;
// }
// }
//}

private float getResoureCache(double Lon, double Lat)
{
double resourceLat = fixUnscale(unScaleLatitude(Lat, resourceMapScale), resourceMapHeight);
Expand Down
30 changes: 9 additions & 21 deletions SCANsat/SCAN_PartModules/SCANsat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ public override void OnUpdate()
Events["stopScan"].active = scanning;
if (sensorType != 32)
Fields["alt_indicator"].guiActive = scanning;

if (powerIsProblem)
{
addStatic();
registerScanner();
}

if (scanning)
{
if (SCANcontroller.controller == null)
Expand Down Expand Up @@ -149,14 +156,6 @@ public override void OnUpdate()
alt_indicator = scanAlt();
}
}
if (vessel == FlightGlobals.ActiveVessel)
{
if (powerIsProblem)
{
addStatic();
registerScanner();
}
}
}

public override void OnLoad(ConfigNode node)
Expand Down Expand Up @@ -332,20 +331,9 @@ private void animate(float speed, float time)
if (anim != null && anim[animationName] != null)
{
anim[animationName].speed = speed;
if (anim.IsPlaying(animationName))
{
if (anim[animationName].normalizedTime <= 0)
{
anim[animationName].normalizedTime = time;
}
else if (anim[animationName].normalizedTime >= 1 - float.Epsilon)
{
anim[animationName].normalizedTime = time;
}
}
else
if (!anim.IsPlaying(animationName))
{
anim[animationName].wrapMode = WrapMode.ClampForever;
anim[animationName].wrapMode = WrapMode.Clamp;
anim[animationName].normalizedTime = time;
anim.Play(animationName);
}
Expand Down
26 changes: 25 additions & 1 deletion SCANsat/SCAN_UI/SCANbigMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class SCANBigMap : SCAN_MBW
private Rect pos_spotmap_x = new Rect(10f, 10f, 25f, 25f);
internal static Rect defaultRect = new Rect(250, 60, 780, 460);

private string exportSize = "";

//private bool overlay = false;
//private int step = 0;

Expand Down Expand Up @@ -520,6 +522,28 @@ private void toggleBar(int id)
if (bigmap.isMapComplete())
bigmap.exportPNG();
}

#if DEBUG
s.x -= 74;
s.y -= 30;
s.width = 60;
s.height = 24;

exportSize = GUI.TextField(s, exportSize, 4);

s.x += 65;

if (GUI.Button(s, "Set"))
{
int i = 0;
if (int.TryParse(exportSize, out i))
{
bigmap.setWidth(i);
drawGrid = true;
SCANcontroller.controller.map_width = bigmap.MapWidth;
}
}
#endif
}

private void mapDraw(int id)
Expand Down Expand Up @@ -577,7 +601,7 @@ private void mapDraw(int id)

if (SCANcontroller.controller.map_grid && !IsResizing)
{
if (gridLines.Count > 0)
if (gridLines.Count > 0 && inRepaint())
{
GL.PushMatrix();
foreach (List<Vector2d> points in gridLines[0])
Expand Down
Loading

0 comments on commit a910044

Please sign in to comment.