/// <summary> /// Add a submenu to this dropdown menu /// </summary> /// <param name="submenu">Submenu to add</param> /// <param name="title">Button title</param> public void AddSubMenu(GI_DropdownSubmenu submenu, string title) { int width = _gameInterface.DropdownButtonWidth; int height = _gameInterface.DropdownButtonHeight; int x = _objs.Count * width; int y = Top; GI_DropdownButton button = new GI_DropdownButton(_gameInterface, _texture, width, height, x, y, title); _objs.Add(button); submenu.Visible = false; button.Clicked += delegate() { if (submenu.Visible) submenu.Close(); else { if (_openSubmenu != null) _openSubmenu.Close(); submenu.Open(); _openSubmenu = submenu; } }; submenu.Position = new Vector2( button.Left, Bottom); }