Exemplo n.º 1
0
        internal void DoIt()
        {
            this.icon = this.GenIcons("Impossible Innovations", "SmallLogo", "SmallLogoON");
            if (KSPe.Util.KSP.Version.Current >= KSPe.Util.KSP.Version.FindByVersion(1, 3, 0))
            {
                AssetIO.ConfigNode defaults = AssetIO.ConfigNode.ForType <ImpossibleInnovations.II_Icons>("ImpossibleInnovations", "defaults.cfg");
                DataIO.ConfigNode  user     = DataIO.ConfigNode.ForType <ImpossibleInnovations.II_Icons>("ImpossibleInnovations", "user.cfg");
                if (!user.IsLoadable)
                {
                    user.Clear();
                    string v = defaults.Load().Node.GetValue("CategoryFilter");
                    user.Node.SetValue("CategoryFilter", v, true);
                    user.Save();
                }
                {
                    user.Load();
                    string CategoryFilter = user.Node.GetValue("CategoryFilter");
                    switch (CategoryFilter)
                    {
                    case "CLASSIC":
                        GameEvents.onGUIEditorToolbarReady.Add(addIIfilter);
                        break;

                    case "NONE":
                        break;

                    default:
                        Log.warn("CategoryFilter [{0}] unrecognized on user settings file!", CategoryFilter);
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void Awake()
        {
            this.icon = this.GenIcons("Impossible Innovations", "SmallLogo", "SmallLogoON");
            if (Versioning.version_major >= 1 && Versioning.version_minor >= 3)
            {
                AssetIO.ConfigNode defaults = AssetIO.ConfigNode.ForType <II_Icons>("ImpossibleInnovations", "defaults.cfg");
                DataIO.ConfigNode  user     = DataIO.ConfigNode.ForType <II_Icons>("ImpossibleInnovations", "user.cfg");
                if (!user.IsLoadable)
                {
                    user.Clear();
                    string v = defaults.Load().Node.GetValue("CategoryFilter");
                    user.Node.SetValue("CategoryFilter", v, true);
                    user.Save();
                }
                {
                    user.Load();
                    string CategoryFilter = user.Node.GetValue("CategoryFilter");
                    switch (CategoryFilter)
                    {
                    case "CLASSIC":
                        GameEvents.onGUIEditorToolbarReady.Add(addIIfilter);
                        break;

                    case "NONE":
                        break;

                    default:
                        Log.warn("CategoryFilter [{0}] unrecognized on user settings file!", CategoryFilter);
                        break;
                    }
                }
            }
        }