protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (Links != null) { for (int i = 0; i < Links.Length; i++) { Links[i] = null; } Links = null; } if (Grid != null) { if (!Grid.IsDisposed) { Grid.Dispose(); } Grid = null; } } }
public override void OnClientAreaChanged(Rectangle oValue, Rectangle nValue) { base.OnClientAreaChanged(oValue, nValue); if (Links == null) { return; } Grid?.Dispose(); Grid = new DXItemGrid { Parent = this, Location = ClientArea.Location, GridSize = new Size(Math.Max(1, (ClientArea.Size.Width) / (DXItemCell.CellWidth - 1)), Math.Max(1, ClientArea.Size.Height / (DXItemCell.CellHeight - 1))), GridType = GridType.Belt, AllowLink = false, }; for (int i = 0; i < Grid.Grid.Length; i++) { new DXLabel { Parent = Grid.Grid[i], Text = ((i + 1) % 10).ToString(), Font = new Font(Config.FontName, CEnvir.FontSize(8F), FontStyle.Italic), IsControl = false, Location = new Point(-2, -1) }; } UpdateLinks(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (Grid != null) { if (!Grid.IsDisposed) { Grid.Dispose(); } Grid = null; } if (GoldLabel != null) { if (!GoldLabel.IsDisposed) { GoldLabel.Dispose(); } GoldLabel = null; } if (WeightLabel != null) { if (!WeightLabel.IsDisposed) { WeightLabel.Dispose(); } WeightLabel = null; } if (FragmentButton != null) { if (!FragmentButton.IsDisposed) { FragmentButton.Dispose(); } FragmentButton = null; } } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (Grid != null) { if (!Grid.IsDisposed) { Grid.Dispose(); } Grid = null; } } }
public StorageDialog() { TitleLabel.Text = "Storage"; SetClientSize(new Size(473, 380)); DXControl filterPanel = new DXControl { Parent = this, Size = new Size(ClientArea.Width, 26), Location = new Point(ClientArea.Location.X, ClientArea.Location.Y), Border = true, BorderColour = Color.FromArgb(198, 166, 99) }; DXLabel label = new DXLabel { Parent = filterPanel, Location = new Point(5, 5), Text = "Name:", }; ItemNameTextBox = new DXTextBox { Parent = filterPanel, Size = new Size(180, 20), Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y), }; ItemNameTextBox.TextBox.TextChanged += (o, e) => ApplyStorageFilter(); label = new DXLabel { Parent = filterPanel, Location = new Point(ItemNameTextBox.Location.X + ItemNameTextBox.Size.Width + 10, 5), Text = "Item:", }; ItemTypeComboBox = new DXComboBox { Parent = filterPanel, Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y), Size = new Size(95, DXComboBox.DefaultNormalHeight), DropDownHeight = 198 }; ItemTypeComboBox.SelectedItemChanged += (o, e) => ApplyStorageFilter(); new DXListBoxItem { Parent = ItemTypeComboBox.ListBox, Label = { Text = $"All" }, 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 = ItemTypeComboBox.ListBox, Label = { Text = description?.Description ?? i.ToString() }, Item = i }; } ItemTypeComboBox.ListBox.SelectItem(null); ClearButton = new DXButton { Size = new Size(80, SmallButtonHeight), Location = new Point(ItemTypeComboBox.Location.X + ItemTypeComboBox.Size.Width + 17, label.Location.Y - 1), Parent = filterPanel, ButtonType = ButtonType.SmallButton, Label = { Text = "Clear" } }; ClearButton.MouseClick += (o, e) => { ItemTypeComboBox.ListBox.SelectItem(null); ItemNameTextBox.TextBox.Text = string.Empty; }; Grid = new DXItemGrid { Parent = this, GridSize = new Size(1, 1), Location = new Point(ClientArea.Location.X, ClientArea.Location.Y + 30), GridType = GridType.Storage, ItemGrid = CEnvir.Storage, VisibleHeight = 10, }; Grid.GridSizeChanged += StorageGrid_GridSizeChanged; StorageScrollBar = new DXVScrollBar { Parent = this, Location = new Point(ClientArea.Right - 14, ClientArea.Location.Y + 31), Size = new Size(14, 349), VisibleSize = 10, Change = 1, }; StorageScrollBar.ValueChanged += StorageScrollBar_ValueChanged; foreach (DXItemCell cell in Grid.Grid) { cell.MouseWheel += StorageScrollBar.DoMouseWheel; } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (Grid != null) { if (!Grid.IsDisposed) { Grid.Dispose(); } Grid = null; } if (TitleLabel != null) { if (!TitleLabel.IsDisposed) { TitleLabel.Dispose(); } TitleLabel = null; } if (GoldLabel != null) { if (!GoldLabel.IsDisposed) { GoldLabel.Dispose(); } GoldLabel = null; } if (GameGoldLabel != null) { if (!GameGoldLabel.IsDisposed) { GameGoldLabel.Dispose(); } GameGoldLabel = null; } if (WeightLabel != null) { if (!WeightLabel.IsDisposed) { WeightLabel.Dispose(); } WeightLabel = null; } if (CurrencyLabel != null) { if (!CurrencyLabel.IsDisposed) { CurrencyLabel.Dispose(); } CurrencyLabel = null; } if (CloseButton != null) { if (!CloseButton.IsDisposed) { CloseButton.Dispose(); } CloseButton = null; } if (SortButton != null) { if (!SortButton.IsDisposed) { SortButton.Dispose(); } SortButton = null; } if (TrashButton != null) { if (!TrashButton.IsDisposed) { TrashButton.Dispose(); } TrashButton = null; } if (GoldTitle != null) { if (!GoldTitle.IsDisposed) { GoldTitle.Dispose(); } GameGoldTitle = null; } if (GameGoldTitle != null) { if (!GameGoldTitle.IsDisposed) { GameGoldTitle.Dispose(); } GameGoldTitle = null; } } }
public InventoryDialogOld() { TitleLabel.Text = "Inventory"; Grid = new DXItemGrid { GridSize = new Size(7, 7), Parent = this, ItemGrid = GameScene.Game.Inventory, GridType = GridType.Inventory }; SetClientSize(new Size(Grid.Size.Width, Grid.Size.Height + 45)); Grid.Location = ClientArea.Location; GoldLabel = new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(ClientArea.Left + 80, ClientArea.Bottom - 41), Text = "0", Size = new Size(ClientArea.Width - 81, 20), Sound = SoundIndex.GoldPickUp }; GoldLabel.MouseClick += GoldLabel_MouseClick; new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, Location = new Point(ClientArea.Left + 1, ClientArea.Bottom - 41), Text = "Gold", Size = new Size(78, 20), IsControl = false, }; WeightLabel = new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(ClientArea.Left + 80, ClientArea.Bottom - 20), Text = "0", Size = new Size(ClientArea.Width - 81, 20), Sound = SoundIndex.GoldPickUp }; new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, Location = new Point(ClientArea.Left + 1, ClientArea.Bottom - 20), Text = "Weight", Size = new Size(78, 20), IsControl = false, }; }
public InventoryDialog() { LibraryFile = LibraryFile.Interface; Index = 130; Movable = true; CloseButton = new DXButton { Parent = this, Index = 15, LibraryFile = LibraryFile.Interface, }; CloseButton.Location = new Point(DisplayArea.Width - CloseButton.Size.Width - 5, 5); CloseButton.MouseClick += (o, e) => Visible = false; TitleLabel = new DXLabel { Text = "Inventory", Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), Outline = true, OutlineColour = Color.Black, IsControl = false, }; TitleLabel.Location = new Point((DisplayArea.Width - TitleLabel.Size.Width) / 2, 8); Grid = new DXItemGrid { GridSize = new Size(6, 8), Parent = this, ItemGrid = GameScene.Game.Inventory, GridType = GridType.Inventory, Location = new Point(20, 39), GridPadding = 1, BackColour = Color.Empty, Border = false }; CEnvir.LibraryList.TryGetValue(LibraryFile.GameInter, out MirLibrary library); DXControl WeightBar = new DXControl { Parent = this, Location = new Point(53, 355), Size = library.GetSize(360), }; WeightBar.BeforeDraw += (o, e) => { if (library == null) { return; } if (MapObject.User.Stats[Stat.BagWeight] == 0) { return; } float percent = Math.Min(1, Math.Max(0, MapObject.User.BagWeight / (float)MapObject.User.Stats[Stat.BagWeight])); if (percent == 0) { return; } MirImage image = library.CreateImage(360, ImageType.Image); if (image == null) { return; } PresentTexture(image.Image, this, new Rectangle(WeightBar.DisplayArea.X, WeightBar.DisplayArea.Y, (int)(image.Width * percent), image.Height), Color.White, WeightBar); }; WeightLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; WeightLabel.SizeChanged += (o, e) => { WeightLabel.Location = new Point(WeightBar.Location.X + (WeightBar.Size.Width - WeightLabel.Size.Width) / 2, WeightBar.Location.Y - 1 + (WeightBar.Size.Height - WeightLabel.Size.Height) / 2); }; GoldTitle = new DXLabel { AutoSize = false, ForeColour = Color.Goldenrod, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.Left, Parent = this, Location = new Point(55, 381), Font = new Font(Config.FontName, CEnvir.FontSize(8F), FontStyle.Bold), Text = "Gold", Size = new Size(97, 20) }; GoldLabel = new DXLabel { AutoSize = false, ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.Right, Parent = this, Location = new Point(80, 381), Text = "0", Size = new Size(97, 20), Sound = SoundIndex.GoldPickUp }; GoldLabel.MouseClick += GoldLabel_MouseClick; GameGoldTitle = new DXLabel { AutoSize = false, ForeColour = Color.DarkOrange, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.Left, Parent = this, Location = new Point(55, 400), Font = new Font(Config.FontName, CEnvir.FontSize(8F), FontStyle.Bold), Text = "GG", Size = new Size(97, 20) }; GameGoldLabel = new DXLabel { AutoSize = false, ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.Right, Parent = this, Location = new Point(80, 400), Text = "0", Size = new Size(97, 20) }; SortButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 364, Parent = this, Location = new Point(180, 384), Hint = "Sort", Enabled = false }; TrashButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 358, Parent = this, Location = new Point(218, 384), Hint = "Trash", Enabled = false }; CurrencyLabel = new DXLabel { Parent = this, Location = new Point(8, 380), Hint = "Wallet [Ctrl + C]", Size = new Size(45, 40), Sound = SoundIndex.GoldPickUp }; CurrencyLabel.MouseClick += CurrencyLabel_MouseClick; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { CompanionDisplay = null; CompanionDisplayPoint = Point.Empty; if (CompanionTabControl != null) { if (!CompanionTabControl.IsDisposed) { CompanionTabControl.Dispose(); } CompanionTabControl = null; } if (CompanionBagTab != null) { if (!CompanionBagTab.IsDisposed) { CompanionBagTab.Dispose(); } CompanionBagTab = null; } if (PickUpFilterTab != null) { if (!PickUpFilterTab.IsDisposed) { PickUpFilterTab.Dispose(); } PickUpFilterTab = null; } if (ItemNameFilterTab != null) { if (!ItemNameFilterTab.IsDisposed) { ItemNameFilterTab.Dispose(); } ItemNameFilterTab = null; } if (EquipmentGrid != null) { for (int i = 0; i < EquipmentGrid.Length; i++) { if (EquipmentGrid[i] != null) { if (!EquipmentGrid[i].IsDisposed) { EquipmentGrid[i].Dispose(); } EquipmentGrid[i] = null; } } EquipmentGrid = null; } if (InventoryGrid != null) { if (!InventoryGrid.IsDisposed) { InventoryGrid.Dispose(); } InventoryGrid = null; } if (WeightLabel != null) { if (!WeightLabel.IsDisposed) { WeightLabel.Dispose(); } WeightLabel = null; } if (HungerLabel != null) { if (!HungerLabel.IsDisposed) { HungerLabel.Dispose(); } HungerLabel = null; } if (NameLabel != null) { if (!NameLabel.IsDisposed) { NameLabel.Dispose(); } NameLabel = null; } if (LevelLabel != null) { if (!LevelLabel.IsDisposed) { LevelLabel.Dispose(); } LevelLabel = null; } if (ExperienceLabel != null) { if (!ExperienceLabel.IsDisposed) { ExperienceLabel.Dispose(); } ExperienceLabel = null; } if (Level3Label != null) { if (!Level3Label.IsDisposed) { Level3Label.Dispose(); } Level3Label = null; } if (Level5Label != null) { if (!Level5Label.IsDisposed) { Level5Label.Dispose(); } Level5Label = null; } if (Level7Label != null) { if (!Level7Label.IsDisposed) { Level7Label.Dispose(); } Level7Label = null; } if (Level10Label != null) { if (!Level10Label.IsDisposed) { Level10Label.Dispose(); } Level10Label = null; } if (ModeComboBox != null) { if (!ModeComboBox.IsDisposed) { ModeComboBox.Dispose(); } ModeComboBox = null; } BagWeight = 0; MaxBagWeight = 0; InventorySize = 0; } }
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 TradeDialog() { TitleLabel.Text = "交易窗口"; Location = new Point(40, 40); UserGrid = new DXItemGrid { GridSize = new Size(5, 3), Parent = this, Location = new Point(ClientArea.X + 5, ClientArea.Y + 25), GridType = GridType.TradeUser, Linked = true, }; foreach (DXItemCell cell in UserGrid.Grid) { cell.LinkChanged += (o, e) => { cell.ReadOnly = cell.Item != null; if (cell.Item == null || GameScene.Game.Observer) { return; } CEnvir.Enqueue(new C.TradeAddItem { Cell = new CellLinkInfo { Slot = cell.Link.Slot, Count = cell.LinkedCount, GridType = cell.Link.GridType } }); }; } PlayerGrid = new DXItemGrid { GridSize = new Size(5, 3), Parent = this, Location = new Point(UserGrid.Location.X + UserGrid.Size.Width + 20, ClientArea.Y + 25), ItemGrid = PlayerItems = new ClientUserItem[15], GridType = GridType.TradePlayer, ReadOnly = true, }; UserLabel = new DXLabel { Text = "用户", Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), Outline = true, OutlineColour = Color.Black, IsControl = false, }; UserLabel.SizeChanged += (o, e) => UserLabel.Location = new Point(UserGrid.Location.X + (UserGrid.Size.Width - UserLabel.Size.Width) / 2, ClientArea.Y); UserLabel.Location = new Point(UserGrid.Location.X + (UserGrid.Size.Width - UserLabel.Size.Width) / 2, ClientArea.Y); PlayerLabel = new DXLabel { Text = "玩家", Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), Outline = true, OutlineColour = Color.Black, IsControl = false, }; PlayerLabel.SizeChanged += (o, e) => PlayerLabel.Location = new Point(PlayerGrid.Location.X + (PlayerGrid.Size.Width - PlayerLabel.Size.Width) / 2, ClientArea.Y); PlayerLabel.Location = new Point(PlayerGrid.Location.X + (PlayerGrid.Size.Width - PlayerLabel.Size.Width) / 2, ClientArea.Y); UserGoldLabel = new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(UserGrid.Location.X + 60, UserGrid.Location.Y + UserGrid.Size.Height + 5), Text = "0", Size = new Size(UserGrid.Size.Width - 61, 20), Sound = SoundIndex.GoldPickUp }; UserGoldLabel.MouseClick += UserGoldLabel_MouseClick; new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, Location = new Point(UserGrid.Location.X + 1, UserGrid.Location.Y + UserGrid.Size.Height + 5), Text = "金币", Size = new Size(58, 20), IsControl = false, }; PlayerGoldLabel = new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(PlayerGrid.Location.X + 60, UserGrid.Location.Y + UserGrid.Size.Height + 5), Text = "0", Size = new Size(UserGrid.Size.Width - 61, 20), Sound = SoundIndex.GoldPickUp }; new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, Location = new Point(PlayerGrid.Location.X + 1, UserGrid.Location.Y + UserGrid.Size.Height + 5), Text = "金币", Size = new Size(58, 20), IsControl = false, }; ConfirmButton = new DXButton { Parent = this, Location = new Point(UserGrid.Location.X + UserGrid.Size.Width - 80, UserGoldLabel.Location.Y + 25), Label = { Text = "确认" }, ButtonType = ButtonType.SmallButton, Size = new Size(80, SmallButtonHeight), }; ConfirmButton.MouseClick += (o, e) => { if (GameScene.Game.Observer) { return; } ConfirmButton.Enabled = false; CEnvir.Enqueue(new C.TradeConfirm()); }; SetClientSize(new Size(PlayerGrid.Size.Width * 2 + 30, PlayerGrid.Size.Height + UserLabel.Size.Height + 15 + UserGoldLabel.Size.Height + ConfirmButton.Size.Height)); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { IsTrading = false; PlayerItems = null; if (UserLabel != null) { if (!UserLabel.IsDisposed) { UserLabel.Dispose(); } UserLabel = null; } if (PlayerLabel != null) { if (!PlayerLabel.IsDisposed) { PlayerLabel.Dispose(); } PlayerLabel = null; } if (UserGrid != null) { if (!UserGrid.IsDisposed) { UserGrid.Dispose(); } UserGrid = null; } if (PlayerGrid != null) { if (!PlayerGrid.IsDisposed) { PlayerGrid.Dispose(); } PlayerGrid = null; } if (UserGoldLabel != null) { if (!UserGoldLabel.IsDisposed) { UserGoldLabel.Dispose(); } UserGoldLabel = null; } if (PlayerGoldLabel != null) { if (!PlayerGoldLabel.IsDisposed) { PlayerGoldLabel.Dispose(); } PlayerGoldLabel = null; } if (ConfirmButton != null) { if (!ConfirmButton.IsDisposed) { ConfirmButton.Dispose(); } ConfirmButton = null; } } }
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; } }; }
public InventoryDialog() { TitleLabel.Text = "Inventory"; Grid = new DXItemGrid { GridSize = new Size(14, 14), Parent = this, ItemGrid = GameScene.Game.Inventory, GridType = GridType.Inventory }; SetClientSize(new Size(Grid.Size.Width, Grid.Size.Height + 45)); Grid.Location = ClientArea.Location; GoldLabel = new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(ClientArea.Left + 80, ClientArea.Bottom - 41), Text = "0", Size = new Size(ClientArea.Width - 81, 20), Sound = SoundIndex.GoldPickUp }; GoldLabel.MouseClick += GoldLabel_MouseClick; new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, Location = new Point(ClientArea.Left + 1, ClientArea.Bottom - 41), Text = "Gold", Size = new Size(78, 20), IsControl = false, }; WeightLabel = new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(ClientArea.Left + 80, ClientArea.Bottom - 20), Text = "0", Size = new Size(ClientArea.Width - 81, 20), Sound = SoundIndex.GoldPickUp }; new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, Location = new Point(ClientArea.Left + 1, ClientArea.Bottom - 20), Text = "Weight", Size = new Size(78, 20), IsControl = false, }; FragmentButton = new DXButton { Location = new Point(ClientArea.Right - 100, Size.Height - 41), Size = new Size(60, DefaultHeight), Parent = this, Label = { Text = "Fragment" } }; FragmentButton.MouseClick += (o, e) => { if (!GameScene.Game.NPCItemFragmentBox.Visible) { GameScene.Game.NPCItemFragmentBox.Visible = true; if (DisplayArea.Left - GameScene.Game.NPCItemFragmentBox.Size.Width < 0) { GameScene.Game.NPCItemFragmentBox.Location = new Point(DisplayArea.Right + 1, DisplayArea.Top); } else { GameScene.Game.NPCItemFragmentBox.Location = new Point(DisplayArea.Left - GameScene.Game.NPCItemFragmentBox.Size.Width, DisplayArea.Top); } } }; }
public InventoryDialog() { TitleLabel.Text = "背包"; Grid = new DXItemGrid { GridSize = new Size(7, 7), Parent = this, ItemGrid = GameScene.Game.Inventory, GridType = GridType.Inventory }; SetClientSize(new Size(Grid.Size.Width, Grid.Size.Height + 85)); Grid.Location = ClientArea.Location; GoldLabel = new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(ClientArea.Left + 80, ClientArea.Bottom - 81), Text = "0", Size = new Size(ClientArea.Width - 81, 20), Sound = SoundIndex.GoldPickUp }; GoldLabel.MouseClick += GoldLabel_MouseClick; new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, Location = new Point(ClientArea.Left + 1, ClientArea.Bottom - 81), Text = "金币", Size = new Size(78, 20), IsControl = false, }; WeightLabel = new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(ClientArea.Left + 80, ClientArea.Bottom - 60), Text = "0", Size = new Size(ClientArea.Width - 81, 20), Sound = SoundIndex.GoldPickUp }; new DXLabel { AutoSize = false, Border = true, BorderColour = Color.FromArgb(99, 83, 50), ForeColour = Color.White, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, Location = new Point(ClientArea.Left + 1, ClientArea.Bottom - 60), Text = "重量", Size = new Size(78, 20), IsControl = false, }; RemoteSellButton = new DXButton { Location = new Point(ClientArea.Left + 1, ClientArea.Bottom - 35), Size = new Size(78, DefaultHeight), Parent = this, Label = { Text = "远程出售" }, Enabled = true, }; RemoteSellButton.MouseClick += (o, e) => OpenSellGoodsDialog(); RemoteFragmentButton = new DXButton { Location = new Point(ClientArea.Left + 80, ClientArea.Bottom - 35), Size = new Size(78, DefaultHeight), Parent = this, Label = { Text = "远程拆解" }, Enabled = true, }; RemoteFragmentButton.MouseClick += (o, e) => OpenFragmentDialog(); MonsterDropListButton = new DXButton { Location = new Point(ClientArea.Left + 159, ClientArea.Bottom - 35), Size = new Size(78, DefaultHeight), Parent = this, Label = { Text = "爆率查询" }, Enabled = true, }; MonsterDropListButton.MouseClick += (o, e) => OpenMonsterDropListDialog(); }