Example #1
0
        /// <summary>
        /// Sets the current Skin to one of the Pre-Defined types
        /// </summary>
        /// <param name="DefaultSkin">Which predefined skin to use</param>
        internal static void SetCurrent(DefSkinType DefaultSkin)
        {
            CC_MBE.LogFormatted_DebugOnly("Setting GUISkin to {0}", DefaultSkin);
            GUISkin OldSkin = _CurrentSkin;

            switch (DefaultSkin)
            {
            case DefSkinType.Unity: _CurrentSkin = DefUnitySkin; break;

            case DefSkinType.KSP: _CurrentSkin = DefKSPSkin; break;

            //case DefSkinType.None: _CurrentSkin = new GUISkin(); break;
            default: _CurrentSkin = DefKSPSkin; break;
            }
            //Now set the tooltip style as well
            SetCurrentTooltip();

            if (OldSkin != CurrentSkin && OnSkinChanged != null)
            {
                OnSkinChanged();
            }
        }
Example #2
0
        /// <summary>
        /// Sets the current skin to one of the custom skins
        /// </summary>
        /// <param name="SkinID">The string ID of the custom skin</param>
        internal static void SetCurrent(String SkinID)
        {
            CC_MBE.LogFormatted_DebugOnly("Setting GUISkin to {0}", SkinID);
            GUISkin OldSkin = _CurrentSkin;

            //check the skin exists, and throw a log line if it doesnt
            if (List.ContainsKey(SkinID))
            {
                _CurrentSkin = List[SkinID];
            }
            else
            {
                CC_MBE.LogFormatted("Unable to change GUISkin to {0}, GUISkin not found", SkinID);
            }

            //Now set the tooltip style as well
            SetCurrentTooltip();

            if (OldSkin != CurrentSkin && OnSkinChanged != null)
            {
                OnSkinChanged();
            }
        }