Example #1
0
        //public static Settings settings;
        //private string globalConfigFilename;
        //private ConfigNode globalNode = new ConfigNode();

        //Awake Event - when the DLL is loaded
        public void Awake()
        {
            if (Instance != null)
            {
                return;
            }
            Instance = this;
            DontDestroyOnLoad(this);
            //settings = new Settings();
            //globalConfigFilename = Path.Combine(_AssemblyFolder, "Config.cfg").Replace("\\", "/");
            //JSIAdvPodsUtil.Log("globalConfigFilename = " + globalConfigFilename);
            //if (!File.Exists(globalConfigFilename))
            //{
            //    settings.Save(globalNode);
            //    globalNode.Save(globalConfigFilename);
            //}
            //globalNode = ConfigNode.Load(globalConfigFilename);
            //settings.Load(globalNode);
            //JSIAdvPodsUtil.debugLoggingEnabled = settings.DebugLogging;
            //JSIAdvPodsUtil.debugLoggingEnabled = HighLogic.CurrentGame.Parameters.CustomParams<JSIATP_SettingsParms>().DebugLogging;
            //LoadedInactive = HighLogic.CurrentGame.Parameters.CustomParams<JSIATP_SettingsParms>().LoadedInactive;
            GameEvents.OnGameSettingsApplied.Add(onGameSettingsApplied);
            GameEvents.onGameStatePostLoad.Add(onGameStatePostLoad);
            JSIAdvPodsUtil.Log("JSIAdvTransparentPods LoadGlobals Awake Complete");
        }
Example #2
0
 //Awake Event - when the DLL is loaded
 public void Awake()
 {
     if (Instance != null)
     {
         return;
     }
     Instance = this;
     DontDestroyOnLoad(this);
     settings             = new Settings();
     globalConfigFilename = Path.Combine(_AssemblyFolder, "Config.cfg").Replace("\\", "/");
     JSIAdvTPodsUtil.Log("globalConfigFilename = " + globalConfigFilename);
     if (!File.Exists(globalConfigFilename))
     {
         settings.Save(globalNode);
         globalNode.Save(globalConfigFilename);
     }
     globalNode = ConfigNode.Load(globalConfigFilename);
     settings.Load(globalNode);
     JSIAdvTPodsUtil.debugLoggingEnabled = settings.DebugLogging;
     JSIAdvTPodsUtil.Log("JSIAdvTransparentPods LoadGlobals Awake Complete");
 }