Пример #1
0
        /**
         * <summary>Draws an outline around the element.</summary>
         * <param name = "isSelected">If True, a different-coloured outline will be used to differentiate it from others</param>
         * <param name = "_menu">The element's parent Menu</param>
         */
        public virtual void DrawOutline(bool isSelected, AC.Menu _menu)
        {
            Color boxColor = Color.yellow;

            if (isSelected)
            {
                boxColor = Color.red;
            }
            for (int i = 0; i < GetNumSlots(); i++)
            {
                if (i > 0)
                {
                    boxColor = Color.blue;
                }
                DrawStraightLine.DrawBox(_menu.GetRectAbsolute(GetSlotRectRelative(i)), boxColor, 1f, false, 0);
            }
        }
Пример #2
0
        public override void DrawOutline(bool isSelected, AC.Menu _menu)
        {
            if (dragType == DragElementType.EntireMenu)
            {
                DrawStraightLine.DrawBox(_menu.GetRectAbsolute(GetDragRectRelative()), Color.white, 1f, false, 1);
            }
            else
            {
                if (!string.IsNullOrEmpty(elementName))
                {
                    MenuElement element = MenuManager.GetElementWithName(_menu.title, elementName);
                    if (element != null)
                    {
                        Rect dragBox = _menu.GetRectAbsolute(GetDragRectRelative());
                        dragBox.x += element.GetSlotRectRelative(0).x;
                        dragBox.y += element.GetSlotRectRelative(0).y;
                        DrawStraightLine.DrawBox(dragBox, Color.white, 1f, false, 1);
                    }
                }
            }

            base.DrawOutline(isSelected, _menu);
        }