|
4 | 4 |
|
5 | 5 | using UnityEngine; |
6 | 6 |
|
| 7 | +using Kopernicus; |
7 | 8 | using Kopernicus.Components; |
8 | 9 | using Kopernicus.Configuration; |
9 | 10 | using Kopernicus.OnDemand; |
10 | | -using System.Threading; |
11 | | -using System.Reflection; |
| 11 | + |
12 | 12 | using KSP.UI.Screens; |
13 | 13 |
|
14 | 14 |
|
@@ -76,22 +76,22 @@ public static void TextureFixer(Body body1, Body body2, List<Body> list) |
76 | 76 | else |
77 | 77 | pBody.generatedBody.celestialBody.gameObject.AddComponent<NameChanger>().newName = "3.1415"; |
78 | 78 | } |
79 | | - else if (Kopernicus.Templates.orbitPatches.ContainsKey(pBody.name) && Kopernicus.Templates.orbitPatches[pBody.name].GetValue("referenceBody") == "Sun") |
| 79 | + else if (pBody.generatedBody.celestialBody.Has("orbitPatches") && pBody.generatedBody.celestialBody.Get<ConfigNode>("orbitPatches").GetValue("referenceBody") == "Sun") |
80 | 80 | { |
81 | 81 | pList.Add(pBody.generatedBody.celestialBody, pBody.generatedBody.orbitDriver.orbit.semiMajorAxis); |
82 | 82 | } |
83 | | - else if (pBody.orbit.referenceBody == "Sun" && !(Kopernicus.Templates.orbitPatches.ContainsKey(pBody.name) && Kopernicus.Templates.orbitPatches[pBody.name].GetValue("referenceBody") != "Sun")) |
| 83 | + else if (pBody.orbit.referenceBody == "Sun" && !(pBody.generatedBody.celestialBody.Has("orbitPatches") && pBody.generatedBody.celestialBody.Get<ConfigNode>("orbitPatches").GetValue("referenceBody") != "Sun")) |
84 | 84 | { |
85 | 85 | if (!(pBody.name == "Kerbin" && SigmaBinary.kerbinFixer != "Sun")) |
86 | 86 | { |
87 | 87 | pList.Add(pBody.generatedBody.celestialBody, pBody.generatedBody.orbitDriver.orbit.semiMajorAxis); |
88 | 88 | } |
89 | 89 | } |
90 | 90 |
|
91 | | - if (pList.ContainsKey(pBody.generatedBody.celestialBody) && Kopernicus.Templates.orbitPatches.ContainsKey(pBody.name) && Kopernicus.Templates.orbitPatches[pBody.name].GetValue("semiMajorAxis") != null) |
| 91 | + if (pList.ContainsKey(pBody.generatedBody.celestialBody) && pBody.generatedBody.celestialBody.Has("orbitPatches") && pBody.generatedBody.celestialBody.Get<ConfigNode>("orbitPatches").GetValue("semiMajorAxis") != null) |
92 | 92 | { |
93 | 93 | NumericParser<double> sma = new NumericParser<double>(); |
94 | | - sma.SetFromString(Kopernicus.Templates.orbitPatches[pBody.name].GetValue("semiMajorAxis")); |
| 94 | + sma.SetFromString(pBody.generatedBody.celestialBody.Get<ConfigNode>("orbitPatches").GetValue("semiMajorAxis")); |
95 | 95 | pList[pBody.generatedBody.celestialBody] = sma.value; |
96 | 96 | } |
97 | 97 | } |
|
0 commit comments