public Notification(string what, int x, int y) { var contents = new MenuItem(what, Constant.NO_OP, Color.Gold); var alpha = contents.color.A; Draw = () => { contents.color.A = alpha -= 3; contents.Draw(x, y); if (alpha <= 5) Draw = Constant.NO_OP; }; }
public bool AddUnique(string text, Action Lambda) { var mi = new MenuItem(text, Lambda); if (contents.Exists(_mi => mi.ToString() == _mi.ToString() && mi.color == _mi.color)) return false; Add(text, Lambda); return true; }
public void GoPrev() { if (activeItem == null) { activeItem = contents.FindLast(mi => mi.Active); // this line not duplicated if (activeItem == null) return; } else { activeItem.highlighted = false; var valid = contents.FindAll(mi => mi.Active); var ndx = valid.IndexOf(activeItem) - 1; // this line not duplicated if (ndx < 0) ndx = valid.Count - 1; // this line not duplicated activeItem = valid[ndx]; } activeItem.highlighted = true; }