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); }
/** * <summary>Gets the element's slot centres, as an array of Vector2s. This is used when keyboard-navigating menus</summary> * <param name = "_menu">The parent Menu</param> * <returns>The element's slot centres, as an array of Vector2s.</returns> */ public Vector2[] GetSlotCentres(AC.Menu _menu) { List <Vector2> slotCentres = new List <Vector2>(); if (isClickable) { for (int i = 0; i < GetNumSlots(); i++) { Vector2 slotCentre = _menu.GetRectAbsolute(GetSlotRectRelative(i)).center; slotCentres.Add(slotCentre); } } return(slotCentres.ToArray()); }
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); } }