public Inventory() { Resizable = true; Size = new Point(400, 300); Position = new Point(400, 200); Titlebar.Text = "Inventory"; left = new Frame(); left.Size = new Point(50, 50); left.Dock = DockStyle.Left; left.Style = "window"; Controls.Add(left); for (int i = 0; i < 6; i++) { ActionButton slot = new ActionButton(); slot.Size = new Point(40, 40); slot.Dock = DockStyle.Top; slot.Margin = new Squid.Margin(5, 5, 5, 0); left.Controls.Add(slot); } top = new Frame(); top.Size = new Point(58, 58); top.Dock = DockStyle.Top; Controls.Add(top); search = new TextBox(); search.Size = new Point(200, 28); search.Dock = DockStyle.Bottom; search.Style = "textbox"; search.Text = "Search..."; search.Margin = new Squid.Margin(8, 0, 8, 0); search.GotFocus += delegate(Control sender) { search.Text = ""; }; search.LostFocus += delegate(Control sender) { search.Text = "Search..."; }; top.Controls.Add(search); bottom = new Frame(); bottom.Size = new Point(38, 38); bottom.Dock = DockStyle.Bottom; bottom.Style = "border"; bottom.Margin = new Squid.Margin(-1, 0, 0, 0); Controls.Add(bottom); view = new ScrollView(); view.Dock = DockStyle.Fill; view.AllowDrop = true; Controls.Add(view); flow = new FlowLayoutFrame(); flow.FlowDirection = FlowDirection.LeftToRight; flow.HSpacing = flow.VSpacing = 4; flow.AutoSize = Squid.AutoSize.Vertical; flow.Dock = DockStyle.Top; view.Controls.Add(flow); Refresh(); }
void Refresh() { flow.Controls.Clear(); foreach (Skill item in GameLogic.Player.Skills) { ActionButton button = new ActionButton(item); button.Size = new Point(40, 40); button.Style = "button"; button.MouseDrag += button_MouseDrag; flow.Controls.Add(button); } }
public CharacterSheet() { Resizable = true; Size = new Point(400, 300); Position = new Point(100, 100); Titlebar.Text = "Character"; split = new SplitContainer(); split.Dock = DockStyle.Fill; Controls.Add(split); stats = new ScrollView(); stats.Dock = DockStyle.Fill; split.SplitFrame1.Controls.Add(stats); paperdoll = new Frame(); paperdoll.Dock = DockStyle.Fill; split.SplitFrame2.Controls.Add(paperdoll); ImageControl image = new ImageControl { Texture = "paperdoll.jpg" }; image.Dock = DockStyle.Fill; paperdoll.Controls.Add(image); //top = new Frame { Size = new Point(44, 44), Dock = DockStyle.Top }; paperdoll.Controls.Add(top); //bottom = new Frame { Size = new Point(44, 44), Dock = DockStyle.Bottom }; paperdoll.Controls.Add(bottom); left = new Frame { Size = new Point(44, 44), Dock = DockStyle.Left }; paperdoll.Controls.Add(left); right = new Frame { Size = new Point(44, 44), Dock = DockStyle.Right }; paperdoll.Controls.Add(right); int i = 0; foreach (KeyValuePair<ItemSlotType, ItemSlot> pair in GameLogic.Player.ItemSlots) { ActionButton button = new ActionButton(); button.Size = new Point(40, 40); button.Style = "button"; button.Dock = DockStyle.Top; button.Margin = new Squid.Margin(2); button.AllowDrop = true; button.DragDrop += button_DragDrop; button.Tooltip = pair.Key.ToString(); button.Tag = pair.Value; if (i < 6) left.Controls.Add(button); else right.Controls.Add(button); i++; } }
void Refresh() { flow.Controls.Clear(); foreach (Item item in GameLogic.Player.Items) { if (item.Equipped) { continue; } ActionButton button = new ActionButton(item); button.Size = new Point(40, 40); button.Style = "button"; button.MouseDrag += button_MouseDrag; flow.Controls.Add(button); } }
public ActionBar() { Size = new Point(44, 44); Dock = DockStyle.Bottom; Frame frame = new Frame(); frame.Dock = DockStyle.CenterX; frame.AutoSize = Squid.AutoSize.Horizontal; Controls.Add(frame); for (int i = 0; i < 8; i++) { ActionButton button = new ActionButton(); button.Size = new Point(40, 40); button.Style = "button"; button.Dock = DockStyle.Left; button.Margin = new Squid.Margin(2); button.AllowDrop = true; button.DragDrop += button_DragDrop; frame.Controls.Add(button); } }
void Refresh() { flow.Controls.Clear(); foreach (Item item in GameLogic.Player.Items) { if (item.Equipped) continue; ActionButton button = new ActionButton(item); button.Size = new Point(40, 40); button.Style = "button"; button.MouseDrag += button_MouseDrag; flow.Controls.Add(button); } }
void button_DragDrop(Control sender, DragDropEventArgs e) { ActionButton slot = sender as ActionButton; slot.Item = e.DraggedControl.Tag as GuiItem; }
public CharacterSheet() { Resizable = true; Size = new Point(400, 300); Position = new Point(100, 100); Titlebar.Text = "Character"; split = new SplitContainer(); split.Dock = DockStyle.Fill; Controls.Add(split); stats = new ScrollView(); stats.Dock = DockStyle.Fill; split.SplitFrame1.Controls.Add(stats); paperdoll = new Frame(); paperdoll.Dock = DockStyle.Fill; split.SplitFrame2.Controls.Add(paperdoll); ImageControl image = new ImageControl { Texture = "paperdoll.jpg" }; image.Dock = DockStyle.Fill; paperdoll.Controls.Add(image); //top = new Frame { Size = new Point(44, 44), Dock = DockStyle.Top }; paperdoll.Controls.Add(top); //bottom = new Frame { Size = new Point(44, 44), Dock = DockStyle.Bottom }; paperdoll.Controls.Add(bottom); left = new Frame { Size = new Point(44, 44), Dock = DockStyle.Left }; paperdoll.Controls.Add(left); right = new Frame { Size = new Point(44, 44), Dock = DockStyle.Right }; paperdoll.Controls.Add(right); int i = 0; foreach (KeyValuePair <ItemSlotType, ItemSlot> pair in GameLogic.Player.ItemSlots) { ActionButton button = new ActionButton(); button.Size = new Point(40, 40); button.Style = "button"; button.Dock = DockStyle.Top; button.Margin = new Squid.Margin(2); button.AllowDrop = true; button.DragDrop += button_DragDrop; button.Tooltip = pair.Key.ToString(); button.Tag = pair.Value; if (i < 6) { left.Controls.Add(button); } else { right.Controls.Add(button); } i++; } }