Skip to content

Commit

Permalink
Merge pull request #242 from S-C-A-N/dev
Browse files Browse the repository at this point in the history
Version 16.9
  • Loading branch information
DMagic1 authored Oct 13, 2016
2 parents dc84749 + f4ce283 commit ef0b20c
Show file tree
Hide file tree
Showing 21 changed files with 631 additions and 406 deletions.
11 changes: 0 additions & 11 deletions SCANassets/MM_Parts/SCANsat_Resource_Scanner.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@
}
}

@PART[*]:HAS[@MODULE[ModuleHighDefCamera]]:FOR[SCANsat]
{
MODULE
{
name = SCANhiDefCamera
minZoom = 8
maxZoom = 20
hiDetailOnly = False
}
}

@PART[OrbitalScanner]:FOR[SCANsat]
{
MODULE
Expand Down
70 changes: 35 additions & 35 deletions SCANassets/Resources/SCANcolors.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -283,144 +283,144 @@ SCAN_Color_Config
highResourceColor = 0.7888628,0,0.94,1
resourceTransparency = 20
defaultMinValue = 1
defaultMaxValue = 7.5
defaultMaxValue = 15
Resource_Planetary_Config
{
Item
{
resourceName = Ore
bodyName = Sun
index = 0
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Kerbin
index = 1
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Mun
index = 2
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Minmus
index = 3
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Moho
index = 4
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Eve
index = 5
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Duna
index = 6
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Ike
index = 7
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Jool
index = 8
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Laythe
index = 9
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Vall
index = 10
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Bop
index = 11
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Tylo
index = 12
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Gilly
index = 13
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Pol
index = 14
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Dres
index = 15
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
Item
{
resourceName = Ore
bodyName = Eeloo
index = 16
lowResourceCutoff = 1
highResourceCutoff = 7.5
lowResourceCutoff = 2.5
highResourceCutoff = 14
}
}
}
Expand Down
14 changes: 7 additions & 7 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":6,
"BUILD":6
"BUILD":9
},
"KSP_VERSION":{
"MAJOR":1,
"MINOR":1,
"PATCH":3
"MINOR":2,
"PATCH":0
},
"KSP_VERSION_MIN":{
"MAJOR":1,
"MINOR":1,
"PATCH":3
"MINOR":2,
"PATCH":0
},
"KSP_VERSION_MAX":{
"MAJOR":1,
"MINOR":1,
"PATCH":3
"MINOR":2,
"PATCH":0
}
}
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.6.0.6")]
[assembly: AssemblyFileVersion("1.6.0.6")]
[assembly: AssemblyInformationalVersion ("v16.6")]
[assembly: AssemblyVersion("1.6.0.9")]
[assembly: AssemblyFileVersion("1.6.0.9")]
[assembly: AssemblyInformationalVersion ("v16.9")]

[assembly: KSPAssembly ("SCANmechjeb", 0, 4)]
[assembly: KSPAssemblyDependency ("SCANsat", 1, 6)]
Expand Down
24 changes: 24 additions & 0 deletions SCANsat/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
Version 16.9 - 2016-10-13
-----------------------

- Update for KSP 1.2 final
- Update to new resource consumption system
- Fix intermittent background scanning gaps
- Only show the manual map size input field in the flight scene
- Adjust Ore concentration cutoff values

Version 16.8 - 2016-9-23
-----------------------

- Fix not loading background scanning vessels
- Add support for displaying new vessel types
- Detect new anomaly types
- Garbage reduction and performance improvements
- Primarily in the background scanning mechanism


Version 16.7 - 2016-9-13
-----------------------

- Update for KSP 1.2

Version 16.6 - 2016-8-18
-----------------------

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.6.0.6")]
[assembly: AssemblyFileVersion ("1.6.0.6")]
[assembly: AssemblyInformationalVersion ("v16.6")]
[assembly: AssemblyVersion ("1.6.0.9")]
[assembly: AssemblyFileVersion ("1.6.0.9")]
[assembly: AssemblyInformationalVersion ("v16.9")]

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

Expand Down
5 changes: 3 additions & 2 deletions SCANsat/SCAN_Data/SCANdata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,12 @@ public SCANanomaly[] Anomalies
{
if (anomalies == null)
{
PQSCity[] sites = body.GetComponentsInChildren<PQSCity>(true);
PQSSurfaceObject[] sites = body.pqsSurfaceObjects;
//PQSCity[] sites = body.GetComponentsInChildren<PQSCity>(true);
anomalies = new SCANanomaly[sites.Length];
for (int i = 0; i < sites.Length; ++i)
{
anomalies[i] = new SCANanomaly(sites[i].name, body.GetLongitude(sites[i].transform.position), body.GetLatitude(sites[i].transform.position), sites[i]);
anomalies[i] = new SCANanomaly(sites[i].SurfaceObjectName, body.GetLongitude(sites[i].transform.position), body.GetLatitude(sites[i].transform.position), sites[i]);
}
}
for (int i = 0; i < anomalies.Length; ++i)
Expand Down
36 changes: 25 additions & 11 deletions SCANsat/SCAN_Data/SCANresourceGlobal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class SCANresourceGlobal : SCAN_ConfigNodeStorage
[Persistent]
private List<SCANresourceBody> Resource_Planetary_Config = new List<SCANresourceBody>();

private Dictionary<string, SCANresourceBody> masterBodyConfigs = new Dictionary<string,SCANresourceBody>();
private DictionaryValueList<string, SCANresourceBody> masterBodyConfigs = new DictionaryValueList<string, SCANresourceBody>();

private SCANtype sType;
private SCANresourceType resourceType;
Expand Down Expand Up @@ -88,13 +88,16 @@ internal SCANresourceGlobal(SCANresourceGlobal copy)
defaultMaxValue = copy.defaultMaxValue;
}

private Dictionary<string, SCANresourceBody> copyBodyConfigs(SCANresourceGlobal c)
private DictionaryValueList<string, SCANresourceBody> copyBodyConfigs(SCANresourceGlobal c)
{
Dictionary<string, SCANresourceBody> newCopy = new Dictionary<string, SCANresourceBody>();
foreach (SCANresourceBody r in c.masterBodyConfigs.Values)
DictionaryValueList<string, SCANresourceBody> newCopy = new DictionaryValueList<string, SCANresourceBody>();
int l = c.masterBodyConfigs.Count;

for (int i = 0; i < l; i++)
{
SCANresourceBody r = c.masterBodyConfigs.At(i);
SCANresourceBody newR = new SCANresourceBody(r);
if (!newCopy.ContainsKey(newR.BodyName))
if (!newCopy.Contains(newR.BodyName))
newCopy.Add(newR.BodyName, newR);
}

Expand All @@ -115,7 +118,18 @@ public override void OnDecodeFromConfigNode()
setDefaultValues();
try
{
masterBodyConfigs = Resource_Planetary_Config.ToDictionary(a => a.BodyName, a => a);
int l = Resource_Planetary_Config.Count;

for (int i = 0; i < l; i++)
{
SCANresourceBody r = Resource_Planetary_Config[i];

if (r == null)
continue;

if (!masterBodyConfigs.Contains(r.BodyName))
masterBodyConfigs.Add(r.BodyName, r);
}
}
catch (Exception e)
{
Expand Down Expand Up @@ -144,7 +158,7 @@ public override void OnEncodeToConfigNode()

public void addToBodyConfigs(string s, SCANresourceBody r, bool warn)
{
if (!masterBodyConfigs.ContainsKey(s))
if (!masterBodyConfigs.Contains(s))
masterBodyConfigs.Add(s, r);
else if (warn)
Debug.LogError(string.Format("[SCANsat] Warning: SCANresource Dictionary Already Contains Key Of This Type: [{0}] For Body: [{1}]", r.ResourceName, s));
Expand Down Expand Up @@ -246,7 +260,7 @@ public int getBodyCount

public SCANresourceBody getBodyConfig (string body, bool warn = true)
{
if (masterBodyConfigs.ContainsKey(body))
if (masterBodyConfigs.Contains(body))
return masterBodyConfigs[body];
else if (warn)
SCANUtil.SCANlog("SCANsat resource celestial body config: [{0}] is empty; something probably went wrong here", body);
Expand All @@ -257,7 +271,7 @@ public SCANresourceBody getBodyConfig (string body, bool warn = true)
public SCANresourceBody getBodyConfig (int i)
{
if (masterBodyConfigs.Count > i)
return masterBodyConfigs.ElementAt(i).Value;
return masterBodyConfigs.At(i);
else
SCANUtil.SCANlog("SCANsat resource celestial body config is empty; something probably went wrong here");

Expand All @@ -266,10 +280,10 @@ public SCANresourceBody getBodyConfig (int i)

public void CurrentBodyConfig(string body)
{
if (masterBodyConfigs.ContainsKey(body))
if (masterBodyConfigs.Contains(body))
currentBody = masterBodyConfigs[body];
else
currentBody = masterBodyConfigs.ElementAt(0).Value;
currentBody = masterBodyConfigs.At(0);
}

public SCANresourceBody CurrentBody
Expand Down
Loading

0 comments on commit ef0b20c

Please sign in to comment.