private void InitializeConfig(ILightArrayConfig lightConfig)
 {
     foreach (var lightArray in lightConfig.LightArrayGroups.SelectMany(group => group.LightArrays))
     {
         lightArray.InitializeDisplay(this);
     }
 }
 public void ReloadPAPIConfig()
 {
     LightConfig.Destroy();  // not perfect..
     LightConfig = LoadConfig();
     //_groupWindow.SetVisible(false);
     //_groupWindow = null;
     //AllLightConfigReloaded(this, e);
 }
Ejemplo n.º 3
0
        public void Awake()
        {
            Util.LogInfo("Awake!");
            fetch         = this;
            _arrayManager = new DefaultLightArrayManager();

            if (_config == null)
            {
                _config = _arrayManager.LoadConfig();
            }
            else
            {
                _arrayManager.LightConfig = _config;
            }

            GameEvents.onGUIApplicationLauncherReady.Add(_arrayManager.InitializeButton);
            postDrawCallbacks = new Callback(_arrayManager.OnGUI);
        }
Ejemplo n.º 4
0
        public void Awake()
        {
            Util.LogInfo("Awake!");

            _arrayManager = new DefaultLightArrayManager();
            _arrayManager.AllLightConfigReloaded += (sender, e) => _config = _arrayManager.LightConfig;

            if (_config == null)
            {
                _config = _arrayManager.LoadConfig();
            }
            else
            {
                _arrayManager.LightConfig = _config;
            }

            _arrayManager.InitializeButton();
        }
Ejemplo n.º 5
0
        public void Awake()
        {
            Util.LogInfo("Awake!");

            _arrayManager = new DefaultLightArrayManager();
            _arrayManager.AllLightConfigReloaded += (sender, e) => _config = _arrayManager.LightConfig;

            if (_config == null)
            {
                _config = _arrayManager.LoadConfig();
            }
            else
            {
                _arrayManager.LightConfig = _config;
            }

            _arrayManager.InitializeButton();
        }
        public ILightArrayConfig LoadConfig()
        {
            Util.LogInfo("Starting to parse light definitions...");

            var stopwatch = Stopwatch.StartNew();

            var defaultConfig = new DefaultLightArrayConfig();

            defaultConfig.LoadConfig();

            LightConfig = defaultConfig;

            Util.LogInfo(string.Format("Finished parsing definitions. Found {0} light groups with a total of {1} light arrays in a time of {2}.",
                                       LightConfig.LightArrayGroups.Count(), LightConfig.LightArrayGroups.Sum(group => group.LightArrays.Count()), stopwatch.Elapsed));

            OnParsingFinished();

            return(LightConfig);
        }
Ejemplo n.º 7
0
        public void Awake()
        {
            if (HighLogic.LoadedScene != GameScenes.FLIGHT && HighLogic.LoadedScene != GameScenes.SPACECENTER)
            {
                enabled = false;
                return;
            }

            Util.LogInfo("Awake!");

            _arrayManager = new DefaultLightArrayManager();

            if (_config == null)
            {
                _config = _arrayManager.LoadConfig();
            }
            else
            {
                _arrayManager.LightConfig = _config;
            }
        }
        public ILightArrayConfig LoadConfig()
        {
            Util.LogInfo("Starting to parse light definitions...");

            var stopwatch = Stopwatch.StartNew();

            var defaultConfig = new DefaultLightArrayConfig();
            defaultConfig.LoadConfig();

            LightConfig = defaultConfig;

            Util.LogInfo(string.Format("Finished parsing definitions. Found {0} light groups with a total of {1} light arrays in a time of {2}.",
                LightConfig.LightArrayGroups.Count(), LightConfig.LightArrayGroups.Sum(group => group.LightArrays.Count()), stopwatch.Elapsed));

            OnParsingFinished();

            return LightConfig;
        }
 private void InitializeConfig(ILightArrayConfig lightConfig)
 {
     foreach (var lightArray in lightConfig.LightArrayGroups.SelectMany(group => group.LightArrays))
     {
         lightArray.InitializeDisplay(this);
     }
 }