private void AddInfoMenu(UIElement menu) { InfoMenu = UIElement.GetContainer("InfoMenu", 0, UIHelper.GetTopRight(margins * -1, margins, (menuWidth / 2) - (2 * margins), menuHeight - (2 * margins))); InfoBack = UIElement.GetImage(PyDraw.getBorderedRectangle((menuWidth / 2) - (2 * margins), menuHeight - (2 * margins), Color.White * 0.2f, 1, Color.White), Color.MediumOrchid, positioner: UIHelper.GetCentered()); InfoMenu.Add(InfoBack); menu.Add(InfoMenu); }
private void ClickItem(Point p, bool h, bool r, bool s, UIElement element) { if (r) { element.Parent.Children.ForEach(e => { HideElement(e); if (element.Id.StartsWith(e.Id)) { ShowElement(e, true); } else if (e.Id.StartsWith(element.Id) && e.Z == element.Z + 1) { ShowElement(e); } else if (e.Z <= element.Z && element.Id.Split('.') is string[] elm && e.Id.Split('.') is string[] el) { if (el.Length == 2 && el[0] == elm[0]) { ShowElement(e); } if (el.Length == 3 && el[1] == elm[1]) { ShowElement(e); } if (el.Length == 4 && el[2] == elm[2]) { ShowElement(e); } if (el.Length == 5 && el[3] == elm[3]) { ShowElement(e); } } }); if (FindMenuItem(menuItems, element.Id) is MenuItem item && item.Screen is UIElement screen) { InfoMenu.Clear(); InfoMenu.Add(InfoBack); InfoMenu.Add(screen); InfoMenu.UpdateBounds(); } } }