protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (ConfirmButton != null) { if (!ConfirmButton.IsDisposed) { ConfirmButton.Dispose(); } ConfirmButton = null; } if (AmountBox != null) { if (!AmountBox.IsDisposed) { AmountBox.Dispose(); } AmountBox = null; } if (ItemCell != null) { if (!ItemCell.IsDisposed) { ItemCell.Dispose(); } ItemCell = null; } } }
public void FilterCell(DXItemCell cell) { if (cell.Slot >= GameScene.Game.StorageSize) { cell.Enabled = false; return; } if (cell.Item == null && (ItemTypeComboBox.SelectedItem != null || !string.IsNullOrEmpty(ItemNameTextBox.TextBox.Text))) { cell.Enabled = false; return; } if (ItemTypeComboBox.SelectedItem != null && cell.Item != null && cell.Item.Info.ItemType != (ItemType)ItemTypeComboBox.SelectedItem) { cell.Enabled = false; return; } if (!string.IsNullOrEmpty(ItemNameTextBox.TextBox.Text) && cell.Item != null && cell.Item.Info.ItemName.IndexOf(ItemNameTextBox.TextBox.Text, StringComparison.OrdinalIgnoreCase) < 0) { cell.Enabled = false; return; } cell.Enabled = true; }
public void FilterPartsCell(DXItemCell cell) { if (cell.Item == null && (ItemTypeComboBox.SelectedItem != null || !string.IsNullOrEmpty(ItemNameTextBox.TextBox.Text))) { cell.Enabled = false; return; } if (ItemTypeComboBox.SelectedItem != null && cell.Item != null && cell.Item.Info.ItemType != (ItemType)ItemTypeComboBox.SelectedItem) { cell.Enabled = false; return; } if (cell.Item != null) { ItemInfo info = Globals.ItemInfoList.Binding.First(x => x.Index == cell.Item.AddedStats[Stat.ItemIndex]); if (!string.IsNullOrEmpty(ItemNameTextBox.TextBox.Text) && info.ItemName.IndexOf(ItemNameTextBox.TextBox.Text, StringComparison.OrdinalIgnoreCase) < 0) { cell.Enabled = false; return; } } if (cell.Item != null && (cell.Item.Info.PartCount <= cell.Item.Count)) { cell.Opacity = 0.8f; } cell.Enabled = true; }
public void Draw(DXItemCell cell, int index) { if (InterfaceLibrary == null) { return; } if (cell.Item != null) { return; } Size s = InterfaceLibrary.GetSize(index); int x = (cell.Size.Width - s.Width) / 2 + cell.DisplayArea.X; int y = (cell.Size.Height - s.Height) / 2 + cell.DisplayArea.Y; InterfaceLibrary.Draw(index, x, y, Color.White, false, 0.2F, ImageType.Image); }
public DXItemAmountWindow(string caption, ClientUserItem item) { HasFooter = true; TitleLabel.Text = caption; SetClientSize(new Size(200, DXItemCell.CellHeight + 10)); Parent = ActiveScene; MessageBoxList.Add(this); Modal = true; Location = new Point((ActiveScene.DisplayArea.Width - DisplayArea.Width) / 2, (ActiveScene.DisplayArea.Height - DisplayArea.Height) / 2); ConfirmButton = new DXButton { Location = new Point(Size.Width / 2 + 10, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "Confirm" } }; ConfirmButton.MouseClick += (o, e) => Dispose(); AmountBox = new DXNumberBox { Parent = this, MaxValue = item.Count, Change = Math.Max(1, item.Count / 5), }; AmountBox.ValueTextBox.ValueChanged += (o, e) => { Amount = AmountBox.Value; if (Amount <= 0) { AmountBox.ValueTextBox.BorderColour = Color.Red; } else if (Amount == AmountBox.MaxValue) { AmountBox.ValueTextBox.BorderColour = Color.Orange; } else { AmountBox.ValueTextBox.BorderColour = Color.Green; } ConfirmButton.Enabled = Amount > 0; if (item.Info.Effect == ItemEffect.Gold) { item.Count = Amount; ItemCell.RefreshItem(); } }; ItemCell = new DXItemCell { Location = new Point(ClientArea.Location.X + (ClientArea.Width - DXItemCell.CellWidth - AmountBox.Size.Width - 5) / 2, ClientArea.Location.Y + 5), Parent = this, FixedBorder = true, Border = true, ItemGrid = new[] { item }, Slot = 0, GridType = GridType.None, ReadOnly = true, }; AmountBox.Location = new Point(ItemCell.Location.X + ItemCell.Size.Width + 10, ItemCell.Location.Y + (ItemCell.Size.Height - AmountBox.Size.Height) / 2); AmountBox.Value = 1; AmountBox.ValueTextBox.KeepFocus = true; AmountBox.ValueTextBox.SetFocus(); AmountBox.ValueTextBox.TextBox.KeyPress += AmountBox_KeyPress; }
public CompanionDialog() { TitleLabel.Text = "宠物"; SetClientSize(new Size(355, 590)); // feature 拾取过滤 物品显示过滤 HasTitle = true; CompanionTabControl = new DXTabControl { Parent = this, Location = ClientArea.Location, Size = ClientArea.Size, }; CompanionBagTab = new DXTab { Parent = CompanionTabControl, Border = true, TabButton = { Label = { Text = "宠物背包" } }, }; PickUpFilterTab = new DXTab { Parent = CompanionTabControl, Border = true, TabButton = { Label = { Text = "拾取过滤" } }, }; ItemNameFilterTab = new DXTab { Parent = CompanionTabControl, Border = true, TabButton = { Label = { Text = "显示过滤" } }, }; CompanionTabControl.SelectedTab = CompanionBagTab; DXControl filterPanel = new DXControl { Parent = PickUpFilterTab, Size = new Size(PickUpFilterTab.Size.Width, 26), Location = new Point(0, 0), Border = true, BorderColour = Color.FromArgb(198, 166, 99) }; DXLabel PickUpFilterItemNameLabel = new DXLabel { Parent = filterPanel, Location = new Point(5, 5), Text = "名字:", }; PickUpFilterItemNameBox = new DXTextBox { Parent = filterPanel, Size = new Size(90, 20), Location = new Point(PickUpFilterItemNameLabel.Location.X + PickUpFilterItemNameLabel.Size.Width + 5, PickUpFilterItemNameLabel.Location.Y), }; PickUpFilterItemNameBox.TextBox.KeyPress += TextBox_KeyPress; PickUpFilterItemTypelabel = new DXLabel { Parent = filterPanel, Location = new Point(PickUpFilterItemNameBox.Location.X + PickUpFilterItemNameBox.Size.Width + 10, 5), Text = "物品:", }; PickUpFilterItemTypeBox = new DXComboBox { Parent = filterPanel, Location = new Point(PickUpFilterItemTypelabel.Location.X + PickUpFilterItemTypelabel.Size.Width + 5, PickUpFilterItemTypelabel.Location.Y), Size = new Size(72, DXComboBox.DefaultNormalHeight), DropDownHeight = 198 }; new DXListBoxItem { Parent = PickUpFilterItemTypeBox.ListBox, Label = { Text = "所有" }, Item = null }; Type itemType = typeof(ItemType); for (ItemType i = ItemType.Nothing; i <= ItemType.ItemPart; i++) { MemberInfo[] infos = itemType.GetMember(i.ToString()); DescriptionAttribute description = infos[0].GetCustomAttribute <DescriptionAttribute>(); new DXListBoxItem { Parent = PickUpFilterItemTypeBox.ListBox, Label = { Text = description?.Description ?? i.ToString() }, Item = i }; } PickUpFilterItemTypeBox.ListBox.SelectItem(null); PickUpFilterSearchButton = new DXButton { Size = new Size(80, SmallButtonHeight), Location = new Point(PickUpFilterItemTypeBox.Location.X + PickUpFilterItemTypeBox.Size.Width + 15, PickUpFilterItemTypelabel.Location.Y - 1), Parent = filterPanel, ButtonType = ButtonType.SmallButton, Label = { Text = "搜索" } }; PickUpFilterSearchButton.MouseClick += (o, e) => Search(); PickUpFilterRow = new PickUpFilterRow[9]; PickupFilterSearchScrollBar = new DXVScrollBar { Parent = PickUpFilterTab, Location = new Point(PickUpFilterTab.Size.Width - 14, filterPanel.Size.Height + 5), Size = new Size(14, PickUpFilterTab.Size.Height - 5 - filterPanel.Size.Height), VisibleSize = PickUpFilterRow.Length, Change = 3, }; PickupFilterSearchScrollBar.ValueChanged += SearchScrollBar_ValueChanged; for (int i = 0; i < PickUpFilterRow.Length; i++) { int index = i; PickUpFilterRow[index] = new PickUpFilterRow { Parent = PickUpFilterTab, Location = new Point(0, filterPanel.Size.Height + 5 + i * 58), }; // SearchRows[index].MouseClick += (o, e) => { SelectedRow = SearchRows[index]; }; PickUpFilterRow[index].MouseWheel += PickupFilterSearchScrollBar.DoMouseWheel; } // feature end //CompanionDisplayPoint = new Point(ClientArea.X + 60, ClientArea.Y + 50); CompanionDisplayPoint = new Point(60, 120); InventoryGrid = new DXItemGrid { GridSize = new Size(10, 10), Parent = CompanionBagTab, GridType = GridType.CompanionInventory, Location = new Point(0, 200), }; EquipmentGrid = new DXItemCell[Globals.CompanionEquipmentSize]; DXItemCell cell; EquipmentGrid[(int)CompanionSlot.Bag] = cell = new DXItemCell { Location = new Point(196, 5), Parent = CompanionBagTab, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Bag, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 99); EquipmentGrid[(int)CompanionSlot.Head] = cell = new DXItemCell { Location = new Point(236, 5), Parent = CompanionBagTab, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Head, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 100); EquipmentGrid[(int)CompanionSlot.Back] = cell = new DXItemCell { Location = new Point(276, 5), Parent = CompanionBagTab, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Back, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 101); EquipmentGrid[(int)CompanionSlot.Food] = cell = new DXItemCell { Location = new Point(316, 5), Parent = CompanionBagTab, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Food, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 102); DXCheckBox PickUpCheckBox = new DXCheckBox { Parent = CompanionBagTab, Label = { Text = "拾取物品:" }, Visible = false }; //PickUpCheckBox.Location = new Point(ClientArea.Right - PickUpCheckBox.Size.Width +3, ClientArea.Y + 45); PickUpCheckBox.Location = new Point(60, 90); /* * new DXLabel * { * AutoSize = false, * Parent = this, * Outline = true, * Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), * ForeColour = Color.FromArgb(198, 166, 99), * OutlineColour = Color.Black, * IsControl = false, * Text = "Abilities", * Location = new Point(ClientArea.X + 196, CompanionDisplayPoint.Y - 20), * Size = new Size(156, 20), * DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, * }; */ DXLabel label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 3", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 70); Level3Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y - 67), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 5", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 50); Level5Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y - 47), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 7", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 30); Level7Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y - 27), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 10", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 10); Level10Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y - 7), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 11", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 10); Level11Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 13), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 13", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 30); Level13Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 33), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 15", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 50); Level15Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 53), Text = "不可用" }; NameLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y - 27) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "名字", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y - 30); LevelLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y - 7) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "等级", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y - 10); ExperienceLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 13) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "经验", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 10); HungerLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 33) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "饥饿度", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 30); WeightLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 53) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "重量", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 50); }
public CompanionDialog() { TitleLabel.Text = "宠物"; SetClientSize(new Size(352, 560)); CompanionDisplayPoint = new Point(ClientArea.X + 60, ClientArea.Y + 50); InventoryGrid = new DXItemGrid { GridSize = new Size(10, 10), Parent = this, GridType = GridType.CompanionInventory, Location = new Point(ClientArea.X, ClientArea.Y + 200), }; EquipmentGrid = new DXItemCell[Globals.CompanionEquipmentSize]; DXItemCell cell; EquipmentGrid[(int)CompanionSlot.Bag] = cell = new DXItemCell { Location = new Point(ClientArea.X + 196, ClientArea.Y + 5), Parent = this, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Bag, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 99); EquipmentGrid[(int)CompanionSlot.Head] = cell = new DXItemCell { Location = new Point(ClientArea.X + 236, ClientArea.Y + 5), Parent = this, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Head, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 100); EquipmentGrid[(int)CompanionSlot.Back] = cell = new DXItemCell { Location = new Point(ClientArea.X + 276, ClientArea.Y + 5), Parent = this, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Back, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 101); EquipmentGrid[(int)CompanionSlot.Food] = cell = new DXItemCell { Location = new Point(ClientArea.X + 316, ClientArea.Y + 5), Parent = this, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Food, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 102); DXCheckBox PickUpCheckBox = new DXCheckBox { Parent = this, Label = { Text = "拾取物品:" }, Visible = false }; PickUpCheckBox.Location = new Point(ClientArea.Right - PickUpCheckBox.Size.Width + 3, ClientArea.Y + 45); /* * new DXLabel * { * AutoSize = false, * Parent = this, * Outline = true, * Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), * ForeColour = Color.FromArgb(198, 166, 99), * OutlineColour = Color.Black, * IsControl = false, * Text = "Abilities", * Location = new Point(ClientArea.X + 196, CompanionDisplayPoint.Y - 20), * Size = new Size(156, 20), * DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, * }; */ DXLabel label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 3", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y); Level3Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 3), Text = "不可用" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 5", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 20); Level5Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 23), Text = "不可用" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 7", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 40); Level7Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 43), Text = "不可用" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 10", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 60); Level10Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 63), Text = "不可用" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 11", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 80); Level11Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 83), Text = "不可用" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 13", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 100); Level13Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 103), Text = "不可用" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 15", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 120); Level15Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 123), Text = "不可用" }; NameLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 43) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "名字", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 40); LevelLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 63) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "等级", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 60); ExperienceLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 83) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "经验", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 80); HungerLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 103) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "饥饿度", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 100); WeightLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 123) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "重量", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 120); }
public CompanionDialog() { TitleLabel.Text = "Companion"; SetClientSize(new Size(352, 441)); CompanionDisplayPoint = new Point(ClientArea.X + 60, ClientArea.Y + 50); InventoryGrid = new DXItemGrid { GridSize = new Size(10, 4), Parent = this, GridType = GridType.CompanionInventory, Location = new Point(ClientArea.X, ClientArea.Y + 300), }; EquipmentGrid = new DXItemCell[Globals.CompanionEquipmentSize]; DXItemCell cell; EquipmentGrid[(int)CompanionSlot.Bag] = cell = new DXItemCell { Location = new Point(ClientArea.X + 196, ClientArea.Y + 5), Parent = this, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Bag, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 99); EquipmentGrid[(int)CompanionSlot.Head] = cell = new DXItemCell { Location = new Point(ClientArea.X + 236, ClientArea.Y + 5), Parent = this, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Head, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 100); EquipmentGrid[(int)CompanionSlot.Back] = cell = new DXItemCell { Location = new Point(ClientArea.X + 276, ClientArea.Y + 5), Parent = this, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Back, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 101); EquipmentGrid[(int)CompanionSlot.Food] = cell = new DXItemCell { Location = new Point(ClientArea.X + 316, ClientArea.Y + 5), Parent = this, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Food, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 102); DXCheckBox PickUpCheckBox = new DXCheckBox { Parent = this, Label = { Text = "Pick up items:" }, Visible = false }; PickUpCheckBox.Location = new Point(ClientArea.Right - PickUpCheckBox.Size.Width + 3, ClientArea.Y + 45); DXButton ConfigButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 116, Parent = this, }; ConfigButton.Location = new Point(ClientArea.X + 2, ClientArea.Y + 5); ConfigButton.MouseClick += (o, e) => GameScene.Game.CompanionOptionsBox.Visible = !GameScene.Game.CompanionOptionsBox.Visible; /* * new DXLabel * { * AutoSize = false, * Parent = this, * Outline = true, * Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), * ForeColour = Color.FromArgb(198, 166, 99), * OutlineColour = Color.Black, * IsControl = false, * Text = "Abilities", * Location = new Point(ClientArea.X + 196, CompanionDisplayPoint.Y - 20), * Size = new Size(156, 20), * DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, * }; */ DXLabel label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 3", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y); Level3Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 3), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 5", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 20); Level5Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 23), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 7", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 40); Level7Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 43), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 10", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 60); Level10Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 63), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 11", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 80); Level11Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 83), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 13", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 100); Level13Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 103), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 15", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 120); Level15Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 123), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 17", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 140); Level17Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 143), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 19", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 160); Level19Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 163), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 21", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 180); Level21Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 183), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 23", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 200); Level23Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 203), Text = "Not Available" }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 25", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 220); Level25Label = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 223), Text = "Not Available" }; NameLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 43) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Name", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 40); LevelLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 63) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 60); ExperienceLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 83) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Experience", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 80); HungerLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 103) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Hunger", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 100); WeightLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 123) }; label = new DXLabel { Parent = this, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Weight", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 120); VisibleChanged += (o, e) => { if (GameScene.Game.CompanionOptionsBox != null) { GameScene.Game.CompanionOptionsBox.Visible = false; } }; }