コード例 #1
0
ファイル: StateHandler.cs プロジェクト: nan0bug00/kerbcam
        public static void LoadConfig()
        {
            ConfigNode config;

            try
            {
                config = ConfigNode.Load(KerbCamGlobals.AssemblyPath + "/kerbcam.cfg");
            }
            catch (NullReferenceException)
            {
                Debug.LogWarning("KerbCam encountered NRE while loading kerbcam.cfg - file corrupted?");
                return;
            }

            if (config == null)
            {
                Debug.LogWarning("KerbCam could not load its configuration. This is okay if one has not been saved yet.");
                return;
            }

            keyBindings.Load(config.GetNode("KEY_BINDINGS"));

            ConfigUtil.Parse <bool>(config, "TOOLBAR_STOCK", out stockToolbar, true);
            ConfigUtil.Parse <bool>(config, "DEV_MODE", out developerMode, false);
        }