예제 #1
0
        public override void Display(GUIStyle _style, int _slot, float zoom, bool isActive)
        {
            base.Display(_style, _slot, zoom, isActive);

            _style.wordWrap  = true;
            _style.alignment = anchor;
            if (zoom < 1f)
            {
                _style.fontSize = (int)((float)_style.fontSize * zoom);
            }

            if (displayType != AC_DisplayType.IconOnly)
            {
                if (textEffects != TextEffects.None)
                {
                    AdvGame.DrawTextEffect(ZoomRect(relativeRect, zoom), label, _style, Color.black, _style.normal.textColor, 2, textEffects);
                }
                else
                {
                    GUI.Label(ZoomRect(relativeRect, zoom), label, _style);
                }
            }
            else
            {
                GUI.Label(ZoomRect(relativeRect, zoom), "", _style);
            }

            if (displayType != AC_DisplayType.TextOnly && icon != null)
            {
                icon.DrawAsInteraction(ZoomRect(relativeRect, zoom), isActive);
            }
        }
예제 #2
0
        /**
         * <summary>Draws the element using OnGUI</summary>
         * <param name = "_style">The GUIStyle to draw with</param>
         * <param name = "_slot">Ignored by this subclass</param>
         * <param name = "zoom">The zoom factor</param>
         * <param name = "isActive If True, then the element will be drawn as though highlighted</param>
         */
        public override void Display(GUIStyle _style, int _slot, float zoom, bool isActive)
        {
            base.Display(_style, _slot, zoom, isActive);

            _style.wordWrap  = true;
            _style.alignment = anchor;
            if (zoom < 1f)
            {
                _style.fontSize = (int)((float)_style.fontSize * zoom);
            }

            if (displayType != AC_DisplayType.IconOnly)
            {
                if (textEffects != TextEffects.None)
                {
                    AdvGame.DrawTextEffect(ZoomRect(relativeRect, zoom), label, _style, Color.black, _style.normal.textColor, outlineSize, textEffects);
                }
                else
                {
                    GUI.Label(ZoomRect(relativeRect, zoom), label, _style);
                }
            }
            else
            {
                GUI.Label(ZoomRect(relativeRect, zoom), "", _style);
            }

            if (overrideTexture)
            {
                if (iconID >= 0 && KickStarter.playerCursor.GetSelectedCursorID() == iconID && activeTexture != null)
                {
                    GUI.DrawTexture(ZoomRect(GetSlotRectRelative(_slot), zoom), activeTexture, ScaleMode.StretchToFill, true, 0f);
                }
            }
            else
            {
                if (displayType != AC_DisplayType.TextOnly && icon != null)
                {
                    icon.DrawAsInteraction(ZoomRect(relativeRect, zoom), isActive);
                }
            }
        }