public void CreateExpressionsViaExpressionsEditorTest() { using (new VerticalGridTestInitializer("verticalGridFeaturesDemo")) { this.UIVerticalGridTreeListMap.SwitchToUnboundExpressionsDemoModule(); this.UIVerticalGridTreeListMap.CreateExpressionsViaExpressionsEditor(); DXButton uIPlusItemButtonButton = UIVerticalGridTreeListMap.UIExpressioneditorWindow.UIPlusItemButtonButton; DXListBoxItem uIDiscountListItem = UIVerticalGridTreeListMap.UIExpressioneditorWindow.UIListOfInputParameterList.UIDiscountListItem; DXListBoxItem uIQuantityListItem = UIVerticalGridTreeListMap.UIExpressioneditorWindow.UIListOfInputParameterList.UIQuantityListItem; DXListBoxItem uIUnitPriceListItem = UIVerticalGridTreeListMap.UIExpressioneditorWindow.UIListOfInputParameterList.UIUnitPriceListItem; Mouse.DoubleClick(uIDiscountListItem); Mouse.Click(uIPlusItemButtonButton, new Point(1, 1)); Mouse.DoubleClick(uIQuantityListItem); Mouse.Click(uIPlusItemButtonButton, new Point(1, 1)); Mouse.DoubleClick(uIUnitPriceListItem); this.UIVerticalGridTreeListMap.ClickExpressionEditorOkButton(); this.UIVerticalGridTreeListMap.CheckAddedUnboundRow(); } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { _Mode = 0; ModeChanged = null; LastPM = null; if (TextBox != null) { if (!TextBox.IsDisposed) { TextBox.Dispose(); } TextBox = null; } if (OptionsButton != null) { if (!OptionsButton.IsDisposed) { OptionsButton.Dispose(); } OptionsButton = null; } if (ChatModeButton != null) { if (!ChatModeButton.IsDisposed) { ChatModeButton.Dispose(); } ChatModeButton = null; } } }
public ExitDialog() { TitleLabel.Text = @"Exit Game"; SetClientSize(new Size(200, 50 + DefaultHeight + DefaultHeight)); ToSelectButton = new DXButton { Location = new Point(ClientArea.X + 35, ClientArea.Y + 20), Size = new Size(130, DefaultHeight), Parent = this, Label = { Text = "Character Select" }, }; ToSelectButton.MouseClick += (o, e) => { if (CEnvir.Now < MapObject.User.CombatTime.AddSeconds(10) && !GameScene.Game.Observer) { GameScene.Game.ReceiveChat("Unable to logout whilst in combat.", MessageType.System); return; } CEnvir.Enqueue(new C.Logout()); }; ExitButton = new DXButton { Location = new Point(ClientArea.X + 35, ClientArea.Y + 30 + DefaultHeight), Size = new Size(130, DefaultHeight), Parent = this, Label = { Text = "Exit Game" }, }; ExitButton.MouseClick += (o, e) => { if (CEnvir.Now < MapObject.User.CombatTime.AddSeconds(10) && !GameScene.Game.Observer) { GameScene.Game.ReceiveChat("Unable to exit game whilst in combat.", MessageType.System); return; } CEnvir.Target.Close(); }; }
private void InitializeComponent() { this.Text = DirectXClientResources.LoadGameTitle; this.Location = new Point(0, 0); this.Size = new Size(800, 600); this.BackColor = Color.White; this.BackColor2 = Color.White; this.okButton = new DXButton(this.ControlHost, this); this.cancelButton = new DXButton(this.ControlHost, this); this.headerLabel = new DXLabel(this.ControlHost, this); //Header Label this.headerLabel.Text = DirectXClientResources.LoadGameLabel; this.headerLabel.Location = new Point(10, 130); this.headerLabel.ForeColor = Color.White; this.headerLabel.AutoSize = true; this.Controls.Add(this.headerLabel); //list box this.listBox = new DXListBox(this.ControlHost, this); this.listBox.Location = new Point(10, 150); this.listBox.Size = new Size(400, 200); this.listBox.BackColor = Color.Black; this.listBox.ForeColor = Color.DarkBlue; this.listBox.SelectedIndexChanged += new System.EventHandler(SelectedFileChanged); this.Controls.Add(this.listBox); //OK button this.okButton.Text = DirectXClientResources.OK; this.okButton.Size = new Size(75, 25); this.okButton.Location = new Point(315, 365); this.okButton.Click += new System.EventHandler(OKButtonPressed); this.Controls.Add(this.okButton); //Cancel Button this.cancelButton.Text = DirectXClientResources.Cancel; this.cancelButton.Size = new Size(75, 25); this.cancelButton.Location = new Point(400, 365); this.Controls.Add(this.cancelButton); }
private void InitializeComponent() { this.Size = this.ControlHost.ScreenBounds.Size; this.Location = new Point(0, 0); this.BackColor = Color.DarkGoldenrod; this.BackColor2 = Color.LightGoldenrodYellow; // //worldSetup // this.worldSetup = new WorldSetupControl(this.ControlHost); this.worldSetup.Size = new Size(this.Size.Width, 600); // //playerSetup // this.playerSetup = new PlayerSetupWindow(this.ControlHost); this.playerSetup.Size = this.Size; this.playerSetup.Size = new Size(this.Size.Width, 600); this.nextButton = new DXButton(this.ControlHost, this); this.backButton = new DXButton(this.ControlHost, this); this.nextButton.Text = "Next >"; this.nextButton.Size = new Size(75, 25); this.nextButton.Click += new System.EventHandler(HandleNextButtonPressed); this.nextButton.Location = new Point(400, 650); this.Controls.Add(this.nextButton); this.backButton.Text = "< Back"; this.backButton.Size = new Size(75, 25); this.backButton.Click += new System.EventHandler(HandleBackButtonPressed); this.backButton.Location = new Point(300, 650); this.Controls.Add(this.backButton); SwapControl(this.worldSetup); }
public ChatOptionsDialog() { TitleLabel.Text = "Chat Options"; HasFooter = true; SetClientSize(new Size(350, 200)); ListBox = new DXListBox { Location = ClientArea.Location, Size = new Size(120, ClientArea.Height - SmallButtonHeight - 5), Parent = this, }; DXButton button = new DXButton { ButtonType = ButtonType.SmallButton, Label = { Text = "Add" }, Parent = this, Size = new Size(50, SmallButtonHeight), }; button.Location = new Point((ListBox.DisplayArea.Right - button.Size.Width), ListBox.DisplayArea.Bottom + 5); button.MouseClick += (o, e) => AddNewTab(null); button = new DXButton { ButtonType = ButtonType.Default, Label = { Text = "Reset All" }, Parent = this, Size = new Size(80, DefaultHeight), Location = new Point(ClientArea.Right - 80 - 10, Size.Height - 43), }; button.MouseClick += (o, e) => { DXMessageBox box = new DXMessageBox("Are you sure you want to reset ALL chat windows", "Chat Reset", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { for (int i = ChatTab.Tabs.Count - 1; i >= 0; i--) { ChatTab.Tabs[i].Panel.RemoveButton.InvokeMouseClick(); } CreateDefaultWindows(); }; }; button = new DXButton { ButtonType = ButtonType.Default, Label = { Text = "Save All" }, Parent = this, Size = new Size(80, DefaultHeight), Location = new Point(ClientArea.X, Size.Height - 43), }; button.MouseClick += (o, e) => { // DXMessageBox box = new DXMessageBox("Are you sure you want to reset ALL chat windows", "Chat Reset", DXMessageBoxButtons.YesNo); GameScene.Game.SaveChatTabs(); GameScene.Game.ReceiveChat("Chat Layout Saved", MessageType.Announcement); }; button = new DXButton { ButtonType = ButtonType.Default, Label = { Text = "Reload All" }, Parent = this, Size = new Size(80, DefaultHeight), Location = new Point(ClientArea.X + 85, Size.Height - 43), }; button.MouseClick += (o, e) => { DXMessageBox box = new DXMessageBox("Are you sure you want to reload ALL chat windows", "Chat reload", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { GameScene.Game.LoadChatTabs(); }; }; }
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 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; }
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 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 MainPanel() { LibraryFile = LibraryFile.GameInter; Index = 50; ExperienceBar = new DXImageControl { Parent = this, LibraryFile = LibraryFile.GameInter, Index = 51, }; ExperienceBar.Location = new Point((Size.Width - ExperienceBar.Size.Width) / 2 + 1, 2 + 1); ExperienceBar.BeforeDraw += (o, e) => { if (ExperienceBar.Library == null) { return; } if (MapObject.User.Level >= Globals.ExperienceList.Count) { return; } decimal MaxExperience = Globals.ExperienceList[MapObject.User.Level]; if (MaxExperience == 0) { return; } //Get percent. MirImage image = ExperienceBar.Library.CreateImage(56, ImageType.Image); if (image == null) { return; } int x = (ExperienceBar.Size.Width - image.Width) / 2; int y = (ExperienceBar.Size.Height - image.Height) / 2; float percent = (float)Math.Min(1, Math.Max(0, MapObject.User.Experience / MaxExperience)); if (percent == 0) { return; } PresentTexture(image.Image, this, new Rectangle(ExperienceBar.DisplayArea.X + x, ExperienceBar.DisplayArea.Y + y - 1, (int)(image.Width * percent), image.Height), Color.White, ExperienceBar); }; DXControl HealthBar = new DXControl { Parent = this, Location = new Point(35, 22), Size = ExperienceBar.Library.GetSize(52), }; HealthBar.BeforeDraw += (o, e) => { if (ExperienceBar.Library == null) { return; } if (MapObject.User.Stats[Stat.Health] == 0) { return; } float percent = Math.Min(1, Math.Max(0, MapObject.User.CurrentHP / (float)MapObject.User.Stats[Stat.Health])); if (percent == 0) { return; } MirImage image = ExperienceBar.Library.CreateImage(52, ImageType.Image); if (image == null) { return; } PresentTexture(image.Image, this, new Rectangle(HealthBar.DisplayArea.X, HealthBar.DisplayArea.Y, (int)(image.Width * percent), image.Height), Color.White, HealthBar); }; DXControl ManaBar = new DXControl { Parent = this, Location = new Point(35, 36), Size = ExperienceBar.Library.GetSize(52), }; ManaBar.BeforeDraw += (o, e) => { if (ExperienceBar.Library == null) { return; } if (MapObject.User.Stats[Stat.Mana] == 0) { return; } float percent = Math.Min(1, Math.Max(0, MapObject.User.CurrentMP / (float)MapObject.User.Stats[Stat.Mana])); if (percent == 0) { return; } MirImage image = ExperienceBar.Library.CreateImage(54, ImageType.Image); if (image == null) { return; } PresentTexture(image.Image, this, new Rectangle(ManaBar.DisplayArea.X, ManaBar.DisplayArea.Y, (int)(image.Width * percent), image.Height), Color.White, ManaBar); }; DXImageControl OtherBar = new DXImageControl { Parent = this, Location = new Point(35, 50), LibraryFile = LibraryFile.GameInter, Index = 58, Visible = false, }; DXButton CharacterButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 82, Parent = this, Location = new Point(650, 23), Hint = "角色 [Q]" }; CharacterButton.MouseClick += (o, e) => { GameScene.Game.CharacterBox.Visible = !GameScene.Game.CharacterBox.Visible; }; DXButton InventoryButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 87, Parent = this, Location = new Point(689, 23), Hint = "背包 [W]\n" + "宠物背包 [U]" }; InventoryButton.MouseClick += (o, e) => GameScene.Game.InventoryBox.Visible = !GameScene.Game.InventoryBox.Visible; DXButton SpellButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 92, Parent = this, Location = new Point(728, 23), Hint = "技能 [E]" }; SpellButton.MouseClick += (o, e) => GameScene.Game.MagicBox.Visible = !GameScene.Game.MagicBox.Visible; DXButton QuestButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 112, Parent = this, Location = new Point(767, 23), Hint = "任务 [J]" }; QuestButton.MouseClick += (o, e) => GameScene.Game.QuestBox.Visible = !GameScene.Game.QuestBox.Visible; DXButton MailButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 97, Parent = this, Location = new Point(806, 23), Hint = "邮件 [,]" }; MailButton.MouseClick += (o, e) => GameScene.Game.MailBox.Visible = !GameScene.Game.MailBox.Visible; NewMailIcon = new DXImageControl { LibraryFile = LibraryFile.GameInter, Index = 240, Parent = MailButton, IsControl = false, Location = new Point(2, 2), Visible = false, }; AvailableQuestIcon = new DXImageControl { LibraryFile = LibraryFile.GameInter, Index = 240, Parent = QuestButton, IsControl = false, Location = new Point(2, 2), Visible = false, }; AvailableQuestIcon.VisibleChanged += (o, e) => { if (AvailableQuestIcon.Visible) { CompletedQuestIcon.Location = new Point(2, QuestButton.Size.Height - CompletedQuestIcon.Size.Height); } else { CompletedQuestIcon.Location = new Point(2, 2); } }; CompletedQuestIcon = new DXImageControl { LibraryFile = LibraryFile.GameInter, Index = 241, Parent = QuestButton, IsControl = false, Location = new Point(2, 2), Visible = false, }; DXButton BeltButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 107, Parent = this, Location = new Point(845, 23), Hint = "快捷栏 [Z]" }; BeltButton.MouseClick += (o, e) => GameScene.Game.BeltBox.Visible = !GameScene.Game.BeltBox.Visible; DXButton GroupButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 102, Parent = this, Location = new Point(884, 23), Hint = "组队 [P]" }; GroupButton.MouseClick += (o, e) => GameScene.Game.GroupBox.Visible = !GameScene.Game.GroupBox.Visible; DXButton ConfigButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 117, Parent = this, Location = new Point(923, 23), Hint = "设置 [O]" }; ConfigButton.MouseClick += (o, e) => GameScene.Game.ConfigBox.Visible = !GameScene.Game.ConfigBox.Visible; DXButton CashShopButton = new DXButton { LibraryFile = LibraryFile.GameInter, Index = 122, Parent = this, Location = new Point(972, 16), Hint = "元宝商铺 [Y]" }; CashShopButton.MouseClick += (o, e) => { if (GameScene.Game.MarketPlaceBox.StoreTab.IsVisible) { GameScene.Game.MarketPlaceBox.Visible = false; } else { GameScene.Game.MarketPlaceBox.Visible = true; GameScene.Game.MarketPlaceBox.StoreTab.TabButton.InvokeMouseClick(); } }; DXLabel label = new DXLabel { Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold), Text = "职业", Hint = "职业", }; label.Location = new Point(300 - label.Size.Width, 20); label = new DXLabel { Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold), Text = "等级", Hint = "等级", }; label.Location = new Point(300 - label.Size.Width, 40); label = new DXLabel { Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold), Text = "防御", }; label.Location = new Point(385 - label.Size.Width, 20); label = new DXLabel { Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold), Text = "魔防", }; label.Location = new Point(470 - label.Size.Width, 20); label = new DXLabel { Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold), Text = "攻击", }; label.Location = new Point(385 - label.Size.Width, 40); DXLabel MCLabelLabel = new DXLabel { Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold), Text = "魔法", }; MCLabelLabel.Location = new Point(470 - MCLabelLabel.Size.Width, 40); DXLabel SCLabelLabel = new DXLabel { Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold), Text = "道术", }; SCLabelLabel.Location = new Point(470 - SCLabelLabel.Size.Width, 40); label = new DXLabel { Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold), Text = "准确", Hint = "准确", }; label.Location = new Point(567 - label.Size.Width, 20); label = new DXLabel { Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold), Text = "敏捷", Hint = "敏捷", }; label.Location = new Point(567 - label.Size.Width, 40); ClassLabel = new DXLabel { AutoSize = false, Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F)), Location = new Point(300, 20), Size = new Size(60, 16), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; LevelLabel = new DXLabel { AutoSize = false, Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F)), Location = new Point(300, 40), Size = new Size(60, 16), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; ACLabel = new DXLabel { AutoSize = false, Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F)), Location = new Point(385, 20), Size = new Size(60, 16), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; MRLabel = new DXLabel { AutoSize = false, Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F)), Location = new Point(470, 20), Size = new Size(60, 16), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; DCLabel = new DXLabel { AutoSize = false, Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F)), Location = new Point(385, 40), Size = new Size(60, 16), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; MCLabel = new DXLabel { AutoSize = false, Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F)), Location = new Point(470, 40), Size = new Size(60, 16), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; MCLabel.VisibleChanged += (o, e) => MCLabelLabel.Visible = MCLabel.Visible; SCLabel = new DXLabel { AutoSize = false, Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F)), Location = new Point(470, 40), Size = new Size(60, 16), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; SCLabel.VisibleChanged += (o, e) => SCLabelLabel.Visible = SCLabel.Visible; AccuracyLabel = new DXLabel { AutoSize = false, Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F)), Location = new Point(567, 20), Size = new Size(60, 16), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; AgilityLabel = new DXLabel { AutoSize = false, Parent = this, Font = new Font(Config.FontName, CEnvir.FontSize(10F)), Location = new Point(567, 40), Size = new Size(60, 16), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; HealthLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; HealthLabel.SizeChanged += (o, e) => { HealthLabel.Location = new Point(HealthBar.Location.X + (HealthBar.Size.Width - HealthLabel.Size.Width) / 2, HealthBar.Location.Y + (HealthBar.Size.Height - HealthLabel.Size.Height) / 2); }; ManaLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; ManaLabel.SizeChanged += (o, e) => { ManaLabel.Location = new Point(ManaBar.Location.X + (ManaBar.Size.Width - ManaLabel.Size.Width) / 2, ManaBar.Location.Y + (ManaBar.Size.Height - ManaLabel.Size.Height) / 2); }; ExperienceLabel = new DXLabel { Parent = this, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; ExperienceLabel.SizeChanged += (o, e) => { ExperienceLabel.Location = new Point(ExperienceBar.Location.X + (ExperienceBar.Size.Width - ExperienceLabel.Size.Width) / 2, ExperienceBar.Location.Y + (ExperienceBar.Size.Height - ExperienceLabel.Size.Height) / 2); }; AttackModeLabel = new DXLabel { Parent = this, ForeColour = Color.Cyan, Outline = true, OutlineColour = Color.Black, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; AttackModeLabel.SizeChanged += (o, e) => { AttackModeLabel.Location = new Point(OtherBar.Location.X, OtherBar.Location.Y + (OtherBar.Size.Height - AttackModeLabel.Size.Height) / 2 - 2); }; PetModeLabel = new DXLabel { Parent = this, ForeColour = Color.Cyan, Outline = true, OutlineColour = Color.Black, DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter }; PetModeLabel.SizeChanged += (o, e) => { PetModeLabel.Location = new Point(OtherBar.Location.X + OtherBar.Size.Width - PetModeLabel.Size.Width, OtherBar.Location.Y + (OtherBar.Size.Height - PetModeLabel.Size.Height) / 2 - 2); }; }
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; } }
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; } } }
private void InitializeComponent() { this.Text = DirectXClientResources.OptionsTitle; this.BackColor = Color.Green; this.BackColor2 = Color.Green; //lblRuleset lblRuleset = new DXLabel(this.ControlHost, this); lblRuleset.Text = DirectXClientResources.RulesetLabel; lblRuleset.AutoSize = true; lblRuleset.Location = new Point(20, 100); this.Controls.Add(lblRuleset); //txtRuleset txtRuleset = new DXTextBox(this.ControlHost, this); txtRuleset.Size = new Size(200, 20); txtRuleset.Location = new Point(150, 100); this.Controls.Add(txtRuleset); //lblTileset lblTileset = new DXLabel(this.ControlHost, this); lblTileset.Text = DirectXClientResources.TilesetLabel; lblTileset.AutoSize = true; lblTileset.Location = new Point(20, 130); this.Controls.Add(lblTileset); //txtTileset txtTileset = new DXTextBox(this.ControlHost, this); txtTileset.Size = new Size(200, 20); txtTileset.Location = new Point(150, 130); this.Controls.Add(txtTileset); //chkShowKilledMessage chkShowKilledMessage = new DXCheckBox(this.ControlHost, this); chkShowKilledMessage.Text = "Show Killed Message"; chkShowKilledMessage.Size = new Size(300, 25); chkShowKilledMessage.Location = new Point(20, 160); this.Controls.Add(chkShowKilledMessage); //chkWaitAfterTurn chkWaitAfterTurn = new DXCheckBox(this.ControlHost, this); chkWaitAfterTurn.Text = "Wait After Turn"; chkWaitAfterTurn.Size = new Size(300, 25); chkWaitAfterTurn.Location = new Point(20, 190); this.Controls.Add(chkWaitAfterTurn); //btnOK btnOK = new DXButton(this.ControlHost, this); btnOK.Text = DirectXClientResources.OK; btnOK.Size = new Size(100, 25); btnOK.Location = new Point(100, 500); btnOK.Click += new EventHandler(OkButtonPressed); this.Controls.Add(btnOK); //btnCancel btnCancel = new DXButton(this.ControlHost, this); btnCancel.Text = DirectXClientResources.Cancel; btnCancel.Size = new Size(100, 25); btnCancel.Location = new Point(220, 500); btnCancel.Click += new EventHandler(CancelButtonPressed); this.Controls.Add(btnCancel); }
public MailDialog() { TitleLabel.Text = "邮件"; HasFooter = true; SetClientSize(new Size(350, 350)); //Rows Header = new MailRow { Parent = this, Location = ClientArea.Location, IsHeader = true, }; Rows = new MailRow[15]; ScrollBar = new DXVScrollBar { Parent = this, Size = new Size(14, ClientArea.Height - 2 - 22), Location = new Point(ClientArea.Right - 14, ClientArea.Top + 1 + 22), VisibleSize = 15, Change = 3, }; ScrollBar.ValueChanged += ScrollBar_ValueChanged; MouseWheel += ScrollBar.DoMouseWheel; DXControl panel = new DXControl { Parent = this, Location = new Point(ClientArea.Location.X, ClientArea.Location.Y + Header.Size.Height + 2), Size = new Size(ClientArea.Width - 16, ClientArea.Size.Height - 22) }; for (int i = 0; i < 15; i++) { int index = i; Rows[index] = new MailRow { Parent = panel, Location = new Point(0, 22 * i), Visible = false, }; Rows[index].MouseClick += (o, e) => { GameScene.Game.ReadMailBox.Mail = Rows[index].Mail; if (Rows[index].Mail.Opened) { return; } Rows[index].Mail.Opened = true; Rows[index].RefreshIcon(); GameScene.Game.MailBox.UpdateIcon(); CEnvir.Enqueue(new C.MailOpened { Index = Rows[index].Mail.Index }); }; Rows[index].MouseWheel += ScrollBar.DoMouseWheel; } CollectAllButton = new DXButton { Location = new Point(ClientArea.Right - 100, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "签收" } }; CollectAllButton.MouseClick += (o, e) => { int count = 15; foreach (ClientMailInfo mail in MailList) { if (count <= 0) { break; } if (mail.Items.Count == 0) { continue; } if (!mail.Opened) { mail.Opened = true; CEnvir.Enqueue(new C.MailOpened { Index = mail.Index }); count--; foreach (MailRow row in Rows) { if (row.Mail != mail) { continue; } row.RefreshIcon(); break; } } foreach (ClientUserItem item in mail.Items) { CEnvir.Enqueue(new C.MailGetItem { Index = mail.Index, Slot = item.Slot }); } count--; } GameScene.Game.MailBox.UpdateIcon(); }; DeleteAll = new DXButton { Location = new Point(ClientArea.Right - 200, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "删除" } }; DeleteAll.MouseClick += (o, e) => { int count = 15; foreach (ClientMailInfo mail in MailList) { if (count <= 0) { break; } if (mail.Items.Count > 0) { continue; } CEnvir.Enqueue(new C.MailDelete { Index = mail.Index }); count--; } }; NewButton = new DXButton { Location = new Point(ClientArea.Right - 300, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "写邮件" } }; NewButton.MouseClick += (o, e) => { GameScene.Game.SendMailBox.Visible = true; GameScene.Game.SendMailBox.BringToFront(); }; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (CollectAllButton != null) { if (!CollectAllButton.IsDisposed) { CollectAllButton.Dispose(); } CollectAllButton = null; } if (DeleteAll != null) { if (!DeleteAll.IsDisposed) { DeleteAll.Dispose(); } DeleteAll = null; } if (NewButton != null) { if (!NewButton.IsDisposed) { NewButton.Dispose(); } NewButton = null; } if (Header != null) { if (!Header.IsDisposed) { Header.Dispose(); } Header = null; } if (ScrollBar != null) { if (!ScrollBar.IsDisposed) { ScrollBar.Dispose(); } ScrollBar = null; } if (NewButton != null) { if (!NewButton.IsDisposed) { NewButton.Dispose(); } NewButton = null; } if (Rows != null) { for (int i = 0; i < Rows.Length; i++) { if (Rows[i] != null) { if (!Rows[i].IsDisposed) { Rows[i].Dispose(); } Rows[i] = null; } } Rows = null; } MailList.Clear(); MailList = null; } }
public ChatOptionsPanel() { DXLabel label = new DXLabel { Text = "Chat Name:", Outline = true, Parent = this, }; label.Location = new Point(74 - label.Size.Width, 1); NameTextBox = new DXTextBox { Location = new Point(74, 1), Size = new Size(80, 20), Parent = this, }; NameTextBox.TextBox.TextChanged += (o, e) => Text = NameTextBox.TextBox.Text; TransparentCheckBox = new DXCheckBox { Label = { Text = "Transparent:" }, Parent = this, Checked = false, }; TransparentCheckBox.Location = new Point(100 - TransparentCheckBox.Size.Width, 40); AlertCheckBox = new DXCheckBox { Label = { Text = "Show Alert:" }, Parent = this, Checked = false, }; AlertCheckBox.Location = new Point(216 - AlertCheckBox.Size.Width, 40); LocalCheckBox = new DXCheckBox { Label = { Text = "Local Chat:" }, Parent = this, Checked = false, }; LocalCheckBox.Location = new Point(100 - LocalCheckBox.Size.Width, 80); WhisperCheckBox = new DXCheckBox { Label = { Text = "Whisper Chat:" }, Parent = this, Checked = false, }; WhisperCheckBox.Location = new Point(216 - WhisperCheckBox.Size.Width, 80); GroupCheckBox = new DXCheckBox { Label = { Text = "Group Chat:" }, Parent = this, Checked = false, }; GroupCheckBox.Location = new Point(100 - GroupCheckBox.Size.Width, 105); GuildCheckBox = new DXCheckBox { Label = { Text = "Guild Chat:" }, Parent = this, Checked = false, }; GuildCheckBox.Location = new Point(216 - GuildCheckBox.Size.Width, 105); ShoutCheckBox = new DXCheckBox { Label = { Text = "Shout Chat:" }, Parent = this, Checked = false, }; ShoutCheckBox.Location = new Point(100 - ShoutCheckBox.Size.Width, 130); GlobalCheckBox = new DXCheckBox { Label = { Text = "Global Chat:" }, Parent = this, Checked = false, }; GlobalCheckBox.Location = new Point(216 - GlobalCheckBox.Size.Width, 130); ObserverCheckBox = new DXCheckBox { Label = { Text = "Observer Chat:" }, Parent = this, Checked = false, }; ObserverCheckBox.Location = new Point(100 - ObserverCheckBox.Size.Width, 155); HintCheckBox = new DXCheckBox { Label = { Text = "Hint Text:" }, Parent = this, Checked = false, }; HintCheckBox.Location = new Point(216 - HintCheckBox.Size.Width, 155); SystemCheckBox = new DXCheckBox { Label = { Text = "System Text:" }, Parent = this, Checked = false, }; SystemCheckBox.Location = new Point(100 - SystemCheckBox.Size.Width, 180); GainsCheckBox = new DXCheckBox { Label = { Text = "Gains Text:" }, Parent = this, Checked = false, }; GainsCheckBox.Location = new Point(216 - GainsCheckBox.Size.Width, 180); RemoveButton = new DXButton { ButtonType = ButtonType.SmallButton, Label = { Text = "Remove" }, Parent = this, Size = new Size(50, SmallButtonHeight), Location = new Point(NameTextBox.DisplayArea.Right + 10, 0), }; }
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(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (NameTextBox != null) { if (!NameTextBox.IsDisposed) { NameTextBox.Dispose(); } NameTextBox = null; } if (RemoveButton != null) { if (!RemoveButton.IsDisposed) { RemoveButton.Dispose(); } RemoveButton = null; } if (TransparentCheckBox != null) { if (!TransparentCheckBox.IsDisposed) { TransparentCheckBox.Dispose(); } TransparentCheckBox = null; } if (AlertCheckBox != null) { if (!AlertCheckBox.IsDisposed) { AlertCheckBox.Dispose(); } AlertCheckBox = null; } if (LocalCheckBox != null) { if (!LocalCheckBox.IsDisposed) { LocalCheckBox.Dispose(); } LocalCheckBox = null; } if (WhisperCheckBox != null) { if (!WhisperCheckBox.IsDisposed) { WhisperCheckBox.Dispose(); } WhisperCheckBox = null; } if (GroupCheckBox != null) { if (!GroupCheckBox.IsDisposed) { GroupCheckBox.Dispose(); } GroupCheckBox = null; } if (GuildCheckBox != null) { if (!GuildCheckBox.IsDisposed) { GuildCheckBox.Dispose(); } GuildCheckBox = null; } if (ShoutCheckBox != null) { if (!ShoutCheckBox.IsDisposed) { ShoutCheckBox.Dispose(); } ShoutCheckBox = null; } if (GlobalCheckBox != null) { if (!GlobalCheckBox.IsDisposed) { GlobalCheckBox.Dispose(); } GlobalCheckBox = null; } if (ObserverCheckBox != null) { if (!ObserverCheckBox.IsDisposed) { ObserverCheckBox.Dispose(); } ObserverCheckBox = null; } if (SystemCheckBox != null) { if (!SystemCheckBox.IsDisposed) { SystemCheckBox.Dispose(); } SystemCheckBox = null; } if (GainsCheckBox != null) { if (!GainsCheckBox.IsDisposed) { GainsCheckBox.Dispose(); } GainsCheckBox = null; } if (HintCheckBox != null) { if (!HintCheckBox.IsDisposed) { HintCheckBox.Dispose(); } HintCheckBox = null; } } }
public CompanionFilterDialog() { CloseButton.Visible = false; TitleLabel.Text = "Filter Companion Pick"; SetClientSize(new Size(350, 341)); 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 = "Class", }; label.Location = new Point(20, 40); DrawClassFilter(); 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 = "Rarity Type", }; label.Location = new Point(20, 100); DrawRarityFilter(); 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 = "Item Type", }; label.Location = new Point(20, 160); DrawItemTypeFilter(); DXButton filterButton = new DXButton { Parent = this, Label = { Text = "Save settings", }, ButtonType = ButtonType.SmallButton, Size = new Size(80, SmallButtonHeight) }; filterButton.Location = new Point(Size.Width / 2 - filterButton.Size.Width / 2, Size.Height - 30); filterButton.MouseClick += (o, e) => { List <MirClass> fClass = GetCheckedItemsClass(); List <Rarity> fRarity = GetCheckedItemsRarity(); List <ItemType> fType = GetCheckedItemsType(); GameScene.Game.User.FiltersClass = String.Join(",", fClass); GameScene.Game.User.FiltersRarity = String.Join(",", fRarity); GameScene.Game.User.FiltersItemType = String.Join(",", fType); CEnvir.Enqueue(new C.SendCompanionFilters { FilterClass = GetCheckedItemsClass(), FilterRarity = GetCheckedItemsRarity(), FilterItemType = GetCheckedItemsType() }); }; }
public BlockDialog() { TitleLabel.Text = "Block List"; HasFooter = false; SetClientSize(new Size(200, 200)); ListBox = new DXListBox { Parent = this, Location = ClientArea.Location, Size = new Size(ClientArea.Width, ClientArea.Height - 25) }; DXButton addButton = new DXButton { Label = { Text = "Add" }, Parent = this, Location = new Point(ClientArea.X, ClientArea.Bottom - 20), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, }; addButton.MouseClick += (o, e) => { DXInputWindow window = new DXInputWindow("Please enter the name of the person you wish to Block.", "Block Player") { ConfirmButton = { Enabled = false }, Modal = true }; window.ValueTextBox.TextBox.TextChanged += (o1, e1) => { window.ConfirmButton.Enabled = Globals.CharacterReg.IsMatch(window.ValueTextBox.TextBox.Text); }; window.ConfirmButton.MouseClick += (o1, e1) => { CEnvir.Enqueue(new C.BlockAdd { Name = window.Value }); }; }; DXButton removeButton = new DXButton { Label = { Text = "Remove" }, Parent = this, Location = new Point(ClientArea.Right - 80, ClientArea.Bottom - 20), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Enabled = false, }; removeButton.MouseClick += (o, e) => { if (ListBox.SelectedItem == null) { return; } DXMessageBox box = new DXMessageBox($"Are you sure you want to Un-Block {ListBox.SelectedItem.Label.Text}?", "Un-Block Player", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { CEnvir.Enqueue(new C.BlockRemove { Index = (int)ListBox.SelectedItem.Item }); }; }; ListBox.selectedItemChanged += (o, e) => { removeButton.Enabled = ListBox.SelectedItem != null; }; RefreshList(); }
public FortuneCheckerDialog() { //HasFooter = true; TitleLabel.Text = "财富检查器"; SetClientSize(new Size(485, 551)); #region Search DXControl filterPanel = new DXControl { Parent = this, Size = new Size(ClientArea.Width, 26), Location = new Point(ClientArea.Left, ClientArea.Top), Border = true, BorderColour = Color.FromArgb(198, 166, 99) }; DXLabel label = new DXLabel { Parent = filterPanel, Location = new Point(5, 5), Text = "名字:", }; ItemNameBox = new DXTextBox { Parent = filterPanel, Size = new Size(180, 20), Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y), }; ItemNameBox.TextBox.KeyPress += TextBox_KeyPress; label = new DXLabel { Parent = filterPanel, Location = new Point(ItemNameBox.Location.X + ItemNameBox.Size.Width + 10, 5), Text = "物品:", }; ItemTypeBox = 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 }; new DXListBoxItem { Parent = ItemTypeBox.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 = ItemTypeBox.ListBox, Label = { Text = description?.Description ?? i.ToString() }, Item = i }; } ItemTypeBox.ListBox.SelectItem(null); SearchButton = new DXButton { Size = new Size(80, SmallButtonHeight), Location = new Point(ItemTypeBox.Location.X + ItemTypeBox.Size.Width + 15, label.Location.Y - 1), Parent = filterPanel, ButtonType = ButtonType.SmallButton, Label = { Text = "搜索" } }; SearchButton.MouseClick += (o, e) => Search(); SearchRows = new FortuneCheckerRow[9]; SearchScrollBar = new DXVScrollBar { Parent = this, Location = new Point(ClientArea.Size.Width - 14 + ClientArea.Left, ClientArea.Y + filterPanel.Size.Height + 5), Size = new Size(14, ClientArea.Height - 5 - filterPanel.Size.Height), VisibleSize = SearchRows.Length, Change = 3, }; SearchScrollBar.ValueChanged += SearchScrollBar_ValueChanged; for (int i = 0; i < SearchRows.Length; i++) { int index = i; SearchRows[index] = new FortuneCheckerRow { Parent = this, Location = new Point(ClientArea.X, ClientArea.Y + filterPanel.Size.Height + 5 + i * 58), }; // SearchRows[index].MouseClick += (o, e) => { SelectedRow = SearchRows[index]; }; SearchRows[index].MouseWheel += SearchScrollBar.DoMouseWheel; } #endregion }
public ChatOptionsPanel() { DXLabel label = new DXLabel { Text = "窗口名称:", Outline = true, Parent = this, }; label.Location = new Point(74 - label.Size.Width, 1); NameTextBox = new DXTextBox { Location = new Point(74, 1), Size = new Size(80, 20), Parent = this, }; NameTextBox.TextBox.TextChanged += (o, e) => Text = NameTextBox.TextBox.Text; TransparentCheckBox = new DXCheckBox { Label = { Text = "透明:" }, Parent = this, Checked = false, }; TransparentCheckBox.Location = new Point(100 - TransparentCheckBox.Size.Width, 40); AlertCheckBox = new DXCheckBox { Label = { Text = "显示告警:" }, Parent = this, Checked = false, }; AlertCheckBox.Location = new Point(216 - AlertCheckBox.Size.Width, 40); LocalCheckBox = new DXCheckBox { Label = { Text = "本地:" }, Parent = this, Checked = false, }; LocalCheckBox.Location = new Point(100 - LocalCheckBox.Size.Width, 80); WhisperCheckBox = new DXCheckBox { Label = { Text = "私聊:" }, Parent = this, Checked = false, }; WhisperCheckBox.Location = new Point(216 - WhisperCheckBox.Size.Width, 80); GroupCheckBox = new DXCheckBox { Label = { Text = "组队:" }, Parent = this, Checked = false, }; GroupCheckBox.Location = new Point(100 - GroupCheckBox.Size.Width, 105); GuildCheckBox = new DXCheckBox { Label = { Text = "公会:" }, Parent = this, Checked = false, }; GuildCheckBox.Location = new Point(216 - GuildCheckBox.Size.Width, 105); ShoutCheckBox = new DXCheckBox { Label = { Text = "大喊:" }, Parent = this, Checked = false, }; ShoutCheckBox.Location = new Point(100 - ShoutCheckBox.Size.Width, 130); GlobalCheckBox = new DXCheckBox { Label = { Text = "全服:" }, Parent = this, Checked = false, }; GlobalCheckBox.Location = new Point(216 - GlobalCheckBox.Size.Width, 130); ObserverCheckBox = new DXCheckBox { Label = { Text = "观察者:" }, Parent = this, Checked = false, }; ObserverCheckBox.Location = new Point(100 - ObserverCheckBox.Size.Width, 155); HintCheckBox = new DXCheckBox { Label = { Text = "提示信息:" }, Parent = this, Checked = false, }; HintCheckBox.Location = new Point(216 - HintCheckBox.Size.Width, 155); SystemCheckBox = new DXCheckBox { Label = { Text = "系统信息:" }, Parent = this, Checked = false, }; SystemCheckBox.Location = new Point(100 - SystemCheckBox.Size.Width, 180); GainsCheckBox = new DXCheckBox { Label = { Text = "拾取信息:" }, Parent = this, Checked = false, }; GainsCheckBox.Location = new Point(216 - GainsCheckBox.Size.Width, 180); RemoveButton = new DXButton { ButtonType = ButtonType.SmallButton, Label = { Text = "移除" }, Parent = this, Size = new Size(50, SmallButtonHeight), Location = new Point(NameTextBox.DisplayArea.Right + 10, 0), }; }
public BlockDialog() { TitleLabel.Text = "黑名单"; HasFooter = false; SetClientSize(new Size(200, 200)); ListBox = new DXListBox { Parent = this, Location = ClientArea.Location, Size = new Size(ClientArea.Width, ClientArea.Height - 25) }; DXButton addButton = new DXButton { Label = { Text = "添加" }, Parent = this, Location = new Point(ClientArea.X, ClientArea.Bottom - 20), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, }; addButton.MouseClick += (o, e) => { DXInputWindow window = new DXInputWindow("请输入您要屏蔽的玩家角色名.", "屏蔽玩家") { ConfirmButton = { Enabled = false }, Modal = true }; window.ValueTextBox.TextBox.TextChanged += (o1, e1) => { window.ConfirmButton.Enabled = Globals.CharacterReg.IsMatch(window.ValueTextBox.TextBox.Text); }; window.ConfirmButton.MouseClick += (o1, e1) => { CEnvir.Enqueue(new C.BlockAdd { Name = window.Value }); }; }; DXButton removeButton = new DXButton { Label = { Text = "移除" }, Parent = this, Location = new Point(ClientArea.Right - 80, ClientArea.Bottom - 20), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Enabled = false, }; removeButton.MouseClick += (o, e) => { if (ListBox.SelectedItem == null) { return; } DXMessageBox box = new DXMessageBox($"您确认对玩家 {ListBox.SelectedItem.Label.Text} 解除屏蔽?", "解除屏蔽", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { CEnvir.Enqueue(new C.BlockRemove { Index = (int)ListBox.SelectedItem.Item }); }; }; ListBox.selectedItemChanged += (o, e) => { removeButton.Enabled = ListBox.SelectedItem != null; }; RefreshList(); }