public static void Init(ConfigNode config) { Debug.LogFormat($"{ModTag} Init()"); All.Clear(); foreach (ConfigNode node in config.GetNodes("TechLevelInfo")) { TechLevelInfo obj = ConfigNode.CreateObjectFromConfig <TechLevelInfo>(node); Debug.LogFormat($"{ModTag} Adding TL {obj}"); All.Add(obj.Level, obj); } initialized = true; }
private void Initialize() { if (!staticInit && GameDatabase.Instance.GetConfigNode("RealAntennas/RealAntennasCommNetParams/RealAntennasCommNetParams") is ConfigNode RAParamNode) { Antenna.BandInfo.Init(RAParamNode); Antenna.Encoder.Init(RAParamNode); TechLevelInfo.Init(RAParamNode); staticInit = true; } float fTSLvl = ScenarioUpgradeableFacilities.GetFacilityLevel(SpaceCenterFacility.TrackingStation); GroundStationTechLevel = Mathf.RoundToInt(MaxTL * (HighLogic.CurrentGame.Mode == Game.Modes.CAREER ? fTSLvl : 1)); }
public static void Init(ConfigNode config) { string res = $"{ModTag} Init()"; All.Clear(); foreach (ConfigNode node in config.GetNodes("TechLevelInfo")) { TechLevelInfo obj = ConfigNode.CreateObjectFromConfig <TechLevelInfo>(node); res += $"\n{ModTag} Adding TL {obj}"; All.Add(obj.Level, obj); MaxTL = Math.Max(MaxTL, obj.Level); } Debug.Log(res); initialized = true; }