Beispiel #1
0
        public static bool IsPartAvailable(AvailablePart ap)
        {
            if (ap == null)
            {
                return(false);
            }
            SpeculativeLevel setting = HighLogic.CurrentGame.Parameters.CustomParams <RealismOverhaulSettings>().speculativeLevel;
            SpeculativeLevel level   = GetSpecLevelFromTags(ap);

            return(level <= setting);
        }
Beispiel #2
0
        // Passed to RF to validate if a engine config should be available
        public static bool IsRFConfigAvailable(ConfigNode cfg)
        {
            if (cfg == null)
            {
                return(false);
            }

            string value = null;

            if (cfg.TryGetValue("specLevel", ref value))
            {
                if (SpeculativeLevel.TryParse(value, true, out SpeculativeLevel valueEnum))
                {
                    SpeculativeLevel setting = HighLogic.CurrentGame.Parameters.CustomParams <RealismOverhaulSettings>().speculativeLevel;
                    return(valueEnum <= setting);
                }
                Debug.Log($"[RODynamicPartHider] Parsing specLevel failed on Engine Config: {cfg.GetValue("name")} ");
            }

            return(true);
        }