public DropOptions(Rectangle r) { this.r = r; this.TL = new DropOptions.RecTexPair(r.X, r.Y, "NewUI/dropdown_menu_corner_TL"); this.TR = new DropOptions.RecTexPair(r.X + r.Width - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_TR"].Width, r.Y, "NewUI/dropdown_menu_corner_TR"); this.BL = new DropOptions.RecTexPair(r.X, r.Y + r.Height - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_BL"].Height, "NewUI/dropdown_menu_corner_BL"); this.BR = new DropOptions.RecTexPair(r.X + r.Width - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_BL"].Width, r.Y + r.Height - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_BR"].Height, "NewUI/dropdown_menu_corner_BR"); this.LV = new DropOptions.RecTexPair(r.X, r.Y + 6, r.Height - 12, "NewUI/dropdown_menu_sides_left"); this.RV = new DropOptions.RecTexPair(r.X + r.Width - 6, r.Y + 6, r.Height - 12, "NewUI/dropdown_menu_sides_right"); this.Top = new DropOptions.RecTexPair(r.X + this.TL.r.Width, r.Y, "NewUI/dropdown_menu_sides_top", r.Width - this.TL.r.Width - this.TR.r.Width); this.Bot = new DropOptions.RecTexPair(r.X + this.TL.r.Width, r.Y + r.Height - 6, "NewUI/dropdown_menu_sides_bottom", r.Width - this.BL.r.Width - this.BR.r.Width); this.container.Add(this.TL); this.container.Add(this.TR); this.container.Add(this.BL); this.container.Add(this.BR); this.container.Add(this.LV); this.container.Add(this.RV); this.container.Add(this.Top); this.container.Add(this.Bot); }
public void Reset() { this.container.Clear(); this.TL = new DropOptions.RecTexPair(this.r.X, this.r.Y, "NewUI/dropdown_menu_corner_TL"); this.TR = new DropOptions.RecTexPair(this.r.X + this.r.Width - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_TR"].Width, this.r.Y, "NewUI/dropdown_menu_corner_TR"); this.BL = new DropOptions.RecTexPair(this.r.X, this.r.Y + this.r.Height - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_BL"].Height, "NewUI/dropdown_menu_corner_BL"); this.BR = new DropOptions.RecTexPair(this.r.X + this.r.Width - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_BL"].Width, this.r.Y + this.r.Height - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_BR"].Height, "NewUI/dropdown_menu_corner_BR"); this.LV = new DropOptions.RecTexPair(this.r.X, this.r.Y + 6, this.r.Height - 12, "NewUI/dropdown_menu_sides_left"); this.RV = new DropOptions.RecTexPair(this.r.X + this.r.Width - 6, this.r.Y + 6, this.r.Height - 12, "NewUI/dropdown_menu_sides_right"); this.Top = new DropOptions.RecTexPair(this.r.X + this.TL.r.Width, this.r.Y, "NewUI/dropdown_menu_sides_top", this.r.Width - this.TL.r.Width - this.TR.r.Width); this.Bot = new DropOptions.RecTexPair(this.r.X + this.TL.r.Width, this.r.Y + this.r.Height - 6, "NewUI/dropdown_menu_sides_bottom", this.r.Width - this.BL.r.Width - this.BR.r.Width); this.container.Add(this.TL); this.container.Add(this.TR); this.container.Add(this.BL); this.container.Add(this.BR); this.container.Add(this.LV); this.container.Add(this.RV); this.container.Add(this.Top); this.container.Add(this.Bot); if (this.Open) { int Height = (this.Options.Count - 1) * 18; this.OpenRect = new Rectangle(this.r.X + 6, this.r.Y + this.r.Height + 3 + 6, this.r.Width - 12, Height - 12); this.ClickAbleOpenRect = new Rectangle(this.r.X + 6, this.r.Y + this.r.Height + 3, this.r.Width - 12, Height - 6); this.TL = new DropOptions.RecTexPair(this.r.X, this.r.Y + this.r.Height + 3, "NewUI/dropdown_menu_corner_TL"); this.TR = new DropOptions.RecTexPair(this.r.X + this.r.Width - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_TR"].Width, this.TL.r.Y, "NewUI/dropdown_menu_corner_TR"); this.BL = new DropOptions.RecTexPair(this.r.X, this.TL.r.Y + Height - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_BL"].Height, "NewUI/dropdown_menu_corner_BL"); this.BR = new DropOptions.RecTexPair(this.r.X + this.r.Width - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_BL"].Width, this.TL.r.Y + Height - ResourceManager.TextureDict["NewUI/dropdown_menu_corner_BR"].Height, "NewUI/dropdown_menu_corner_BR"); this.LV = new DropOptions.RecTexPair(this.r.X, this.TL.r.Y + 6, Height - 12, "NewUI/dropdown_menu_sides_left"); this.RV = new DropOptions.RecTexPair(this.r.X + this.r.Width - 6, this.TL.r.Y + 6, Height - 12, "NewUI/dropdown_menu_sides_right"); this.Top = new DropOptions.RecTexPair(this.r.X + this.TL.r.Width, this.TL.r.Y, "NewUI/dropdown_menu_sides_top", this.r.Width - this.TL.r.Width - this.TR.r.Width); this.Bot = new DropOptions.RecTexPair(this.r.X + this.TL.r.Width, this.TL.r.Y + Height - 6, "NewUI/dropdown_menu_sides_bottom", this.r.Width - this.BL.r.Width - this.BR.r.Width); this.container.Add(this.TL); this.container.Add(this.TR); this.container.Add(this.BL); this.container.Add(this.BR); this.container.Add(this.LV); this.container.Add(this.RV); this.container.Add(this.Top); this.container.Add(this.Bot); } }