/// <summary>
        /// Initializes a new instance of the <see cref="EngineLoadingDialog"/> class.
        /// </summary>
        /// <param name="controlHost"></param>
        public EngineLoadingDialog(IDirectXControlHost controlHost) : base(controlHost)
        {
            this.ShadeHeader = false;

            //instructions
            instructionsLabel           = new DXLabel(this.ControlHost, this);
            instructionsLabel.AutoSize  = true;
            instructionsLabel.Location  = new Point(50, 50);
            instructionsLabel.ForeColor = Color.White;
            instructionsLabel.Text      = "Please wait while the 3D engine is initialized.";
            this.Controls.Add(instructionsLabel);

            //progress bar
            progressBar           = new DXProgressBar(this.ControlHost, this);
            progressBar.Size      = new Size(450, 15);
            progressBar.Location  = new Point(20, 100);
            progressBar.ForeColor = Color.Blue;
            this.Controls.Add(progressBar);

            //progress status label
            progressLabel           = new DXLabel(this.ControlHost, this);
            progressLabel.Location  = new Point(20, 80);
            progressLabel.AutoSize  = true;
            progressLabel.ForeColor = Color.White;
            this.Controls.Add(progressLabel);
        }
예제 #2
0
        private void DrawClassFilter()
        {
            Array classes = Enum.GetValues(typeof(MirClass));
            int   index   = 0;

            foreach (MirClass mirClass in classes)
            {
                FilterClass[mirClass] = new DXCheckBox
                {
                    Parent = this,
                    Hint   = "Pick " + mirClass.ToString().ToLower() + " items",
                };
                FilterClass[mirClass].Location = new Point(20 + (70 * index), 70);

                DXLabel label = new DXLabel
                {
                    Parent        = this,
                    Outline       = true,
                    ForeColour    = Color.AntiqueWhite,
                    OutlineColour = Color.Black,
                    IsControl     = false,
                    Text          = char.ToUpper(mirClass.ToString()[0]) + mirClass.ToString().Substring(1)
                };
                label.Location = new Point(35 + (70 * index++), 70);
            }
        }
예제 #3
0
        private void InitializeComponent()
        {
            this.Location  = new Point(50, 50);
            this.Size      = new Size(500, 200);
            this.BackColor = SystemColors.Control;
            this.ForeColor = SystemColors.ActiveCaption;
            this.Text      = "Name your new city...";

            _lblCityName          = new DXLabel(this.ControlHost, this);
            _lblCityName.Text     = "City Name";
            _lblCityName.Font     = new System.Drawing.Font("Arial", 10.25F, FontStyle.Bold);
            _lblCityName.Location = new Point(20, 60);
            this.Controls.Add(_lblCityName);

            _txtCityName          = new DXTextBox(this.ControlHost, this);
            _txtCityName.Location = new Point(80, 60);
            _txtCityName.Size     = new Size(200, 20);
            this.Controls.Add(_txtCityName);

            _btnOK          = new DXButton(this.ControlHost, this);
            _btnOK.Text     = "OK";
            _btnOK.Location = new Point(285, 160);
            _btnOK.Size     = new Size(75, 25);
            _btnOK.Click   += new EventHandler(this.OnOK);
            this.Controls.Add(_btnOK);

            _btnCancel          = new DXButton(this.ControlHost, this);
            _btnCancel.Text     = "Cancel";
            _btnCancel.Location = new Point(375, 160);
            _btnCancel.Size     = new Size(75, 25);
            _btnCancel.Click   += new EventHandler(OnCancel);
            this.Controls.Add(_btnCancel);
        }
예제 #4
0
        private void InitializeComponent()
        {
            this.Location  = new Point(50, 50);
            this.Size      = new Size(300, 200);
            this.BackColor = SystemColors.Control;
            this.ForeColor = SystemColors.ActiveCaption;
            this.Text      = "Terrain View";

            _doneButton          = new DXButton(this.ControlHost, this);
            _doneButton.Text     = "Done";
            _doneButton.Size     = new Size(75, 25);
            _doneButton.Location = new Point(200, 150);
            _doneButton.Click   += new System.EventHandler(this.DonePressed);
            this.Controls.Add(_doneButton);

            _lblTerrain          = new DXLabel(this.ControlHost, this);
            _lblTerrain.Text     = _cell.Terrain.Name;
            _lblTerrain.Location = new Point(20, 50);
            this.Controls.Add(_lblTerrain);

            _lblFoodHDR          = new DXLabel(this.ControlHost, this);
            _lblFoodHDR.Text     = "Food:";
            _lblFoodHDR.Location = new Point(100, 50);
            this.Controls.Add(_lblFoodHDR);

            _lblFood          = new DXLabel(this.ControlHost, this);
            _lblFood.Text     = _cell.FoodUnits.ToString();
            _lblFood.Location = new Point(150, 50);
            this.Controls.Add(_lblFood);

            _lblGoldHDR          = new DXLabel(this.ControlHost, this);
            _lblGoldHDR.Text     = "Gold:";
            _lblGoldHDR.Location = new Point(100, 75);
            this.Controls.Add(_lblGoldHDR);

            _lblGold          = new DXLabel(this.ControlHost, this);
            _lblGold.Text     = _cell.GoldPerTurn.ToString();
            _lblGold.Location = new Point(150, 75);
            this.Controls.Add(_lblGold);

            _lblShieldsHDR          = new DXLabel(this.ControlHost, this);
            _lblShieldsHDR.Text     = "Shields:";
            _lblShieldsHDR.Location = new Point(100, 100);
            this.Controls.Add(_lblShieldsHDR);

            _lblShields          = new DXLabel(this.ControlHost, this);
            _lblShields.Text     = _cell.Shields.ToString();
            _lblShields.Location = new Point(150, 100);
            this.Controls.Add(_lblShields);
        }
예제 #5
0
        private void InitializeComponent()
        {
            this.Size      = new Size(500, 500);
            this.Font      = SystemInformation.MenuFont;
            this.BackColor = SystemColors.Control;
            this.ForeColor = SystemColors.ActiveCaption;
            this.Text      = "City Details";

            lblCity          = new DXLabel(this.ControlHost, this);
            lblCity.Text     = city.Name;
            lblCity.Location = new Point(50, 50);
            this.Controls.Add(lblCity);

            lblNextProjectHDR          = new DXLabel(this.ControlHost, this);
            lblNextProjectHDR.Text     = "Producing:";
            lblNextProjectHDR.Location = new Point(10, 75);
            this.Controls.Add(lblNextProjectHDR);

            lblNextProject          = new DXLinkLabel(this.ControlHost, this);
            lblNextProject.Text     = city.NextImprovement.Name;
            lblNextProject.Location = new Point(100, 75);
            this.Controls.Add(lblNextProject);

            lblProgressHDR          = new DXLabel(this.ControlHost, this);
            lblProgressHDR.Text     = "Progress:";
            lblProgressHDR.Location = new Point(10, 110);
            this.Controls.Add(lblProgressHDR);

            lblProgress          = new DXLabel(this.ControlHost, this);
            lblProgress.Text     = city.Shields.ToString() + "/" + city.NextImprovement.Cost.ToString();
            lblProgress.Location = new Point(100, 110);
            this.Controls.Add(lblProgress);

            lblImprovements          = new DXLabel(this.ControlHost, this);
            lblImprovements.Text     = "Improvements:";
            lblImprovements.Location = new Point(10, 145);
            this.Controls.Add(lblImprovements);

            lstImprovements          = new DXListBox(this.ControlHost, this);
            lstImprovements.Location = new Point(100, 145);
            lstImprovements.Size     = new Size(200, 300);
            this.Controls.Add(lstImprovements);

            btnDone          = new DXButton(this.ControlHost, this);
            btnDone.Text     = "Done";
            btnDone.Location = new Point(400, 450);
            btnDone.Size     = new Size(75, 25);
            btnDone.Click   += new EventHandler(this.DonePressed);
            this.Controls.Add(btnDone);
        }
        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;
                }
            }
        }
예제 #7
0
        private void DrawItemTypeFilter()
        {
            Array itemTypes = Enum.GetValues(typeof(ItemType));
            int   index     = 0;
            int   row       = 0;

            foreach (ItemType itemType in itemTypes)
            {
                string item = itemType.ToString();
                if (item == "Torch" || item == "Meat" || item == "System" || item == "ItemPart")
                {
                    continue;
                }

                if (item == "Nothing")
                {
                    item = "Misc.";
                }

                FilterType[itemType] = new DXCheckBox
                {
                    Parent = this,
                    Hint   = "Pick " + item.ToLower() + " items",
                };
                FilterType[itemType].Location = new Point(20 + (110 * index), 190 + (18 * row));

                DXLabel label = new DXLabel
                {
                    Parent        = this,
                    Outline       = true,
                    ForeColour    = Color.AntiqueWhite,
                    OutlineColour = Color.Black,
                    IsControl     = false,
                    Text          = char.ToUpper(item[0]) + item.Substring(1)
                };
                label.Location = new Point(35 + (110 * index++), 190 + (18 * row));
                if (index % 3 == 0)
                {
                    row++;
                    index = 0;
                }
            }
        }
예제 #8
0
        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);
        }
예제 #9
0
        public void ResizeChat()
        {
            if (!IsResizing)
            {
                foreach (DXLabel label in History)
                {
                    if (label.Size.Width == TextPanel.Size.Width)
                    {
                        continue;
                    }

                    Size size = DXLabel.GetHeight(label, TextPanel.Size.Width);
                    label.Size = new Size(size.Width, size.Height);

                    //label.Size = new Size(TextPanel.Size.Width, DXLabel.GetHeight(label, TextPanel.Size.Width).Height);
                }

                UpdateItems();
                UpdateScrollBar();
            }
        }
예제 #10
0
        public override void NameChanged()
        {
            base.NameChanged();

            if (string.IsNullOrEmpty(Name))
            {
                FocusLabel = null;
            }
            else
            {
                if (!NameLabels.TryGetValue(Name, out List <DXLabel> focused))
                {
                    NameLabels[Name] = focused = new List <DXLabel>();
                }

                FocusLabel = focused.FirstOrDefault(x => x.ForeColour == NameColour && x.BackColour == LabelBackColour);

                if (FocusLabel != null)
                {
                    return;
                }

                FocusLabel = new DXLabel
                {
                    BackColour    = LabelBackColour,
                    ForeColour    = NameColour,
                    Outline       = true,
                    OutlineColour = Color.Black,
                    Text          = Name,
                    Border        = true,
                    BorderColour  = Color.Black,
                    IsVisible     = true,
                };

                FocusLabel.Disposing += (o, e) => focused.Remove(FocusLabel);
                focused.Add(FocusLabel);
            }
        }
예제 #11
0
        private void DrawRarityFilter()
        {
            Array rarities = Enum.GetValues(typeof(Rarity));
            int   index    = 0;

            foreach (Rarity rarity in rarities)
            {
                FilterRarity[rarity] = new DXCheckBox
                {
                    Parent = this,
                    Hint   = "Pick " + rarity.ToString().ToLower() + " items",
                };
                FilterRarity[rarity].Location = new Point(20 + (70 * index), 130);
                Color rarityLabelColor = Color.AntiqueWhite;
                switch (rarity)
                {
                case Rarity.Elite:
                    rarityLabelColor = Color.MediumPurple;
                    break;

                case Rarity.Superior:
                    rarityLabelColor = Color.PaleGreen;
                    break;
                }
                DXLabel label = new DXLabel
                {
                    Parent        = this,
                    Outline       = true,
                    ForeColour    = rarityLabelColor,
                    OutlineColour = Color.Black,
                    IsControl     = false,
                    Text          = char.ToUpper(rarity.ToString()[0]) + rarity.ToString().Substring(1)
                };
                label.Location = new Point(35 + (70 * index++), 130);
            }
        }
예제 #12
0
        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;
            }
        }
예제 #13
0
        public CompanionOptionsDialog()
        {
            TitleLabel.Text = "Companion Options";
            SetClientSize(new Size(182, 341));
            Movable = false;

            TypeFilterLabel = 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 Filter:",
            };
            TypeFilterLabel.Location = new Point(ClientArea.Left + 3, ClientArea.Y + 1);
            CheckBoxRightPoint       = new Point(TypeFilterLabel.Size.Width, 0);
            int i   = 22;
            int gap = 16;

            GoldCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Gold:" },
                Visible    = true
            };
            GoldCheckBox.Location    = new Point(CheckBoxRightPoint.X - GoldCheckBox.Size.Width, ClientArea.Y + i);
            GoldCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Gold
                });
            };
            i += gap;

            WeaponCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Weapon:" },
                Visible    = true
            };
            WeaponCheckBox.Location    = new Point(CheckBoxRightPoint.X - WeaponCheckBox.Size.Width, ClientArea.Y + i);
            WeaponCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Weapon
                });
            };
            i += gap;

            ArmourCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Armour:" },
                Visible    = true
            };
            ArmourCheckBox.Location    = new Point(CheckBoxRightPoint.X - ArmourCheckBox.Size.Width, ClientArea.Y + i);
            ArmourCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Armour
                });
            };
            i += gap;

            HelmetCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Helmet:" },
                Visible    = true
            };
            HelmetCheckBox.Location    = new Point(CheckBoxRightPoint.X - HelmetCheckBox.Size.Width, ClientArea.Y + i);
            HelmetCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Helmet
                });
            };
            i += gap;

            ShieldCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Shield:" },
                Visible    = true
            };
            ShieldCheckBox.Location    = new Point(CheckBoxRightPoint.X - ShieldCheckBox.Size.Width, ClientArea.Y + i);
            ShieldCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Shield
                });
            };
            i += gap;

            NecklaceCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Necklace:" },
                Visible    = true
            };
            NecklaceCheckBox.Location    = new Point(CheckBoxRightPoint.X - NecklaceCheckBox.Size.Width, ClientArea.Y + i);
            NecklaceCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Necklace
                });
            };
            i += gap;

            BraceletCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Bracelet:" },
                Visible    = true
            };
            BraceletCheckBox.Location    = new Point(CheckBoxRightPoint.X - BraceletCheckBox.Size.Width, ClientArea.Y + i);
            BraceletCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Bracelet
                });
            };
            i += gap;

            RingCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Ring:" },
                Visible    = true
            };
            RingCheckBox.Location    = new Point(CheckBoxRightPoint.X - RingCheckBox.Size.Width, ClientArea.Y + i);
            RingCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Ring
                });
            };
            i += gap;

            ShoesCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Shoes:" },
                Visible    = true
            };
            ShoesCheckBox.Location    = new Point(CheckBoxRightPoint.X - ShoesCheckBox.Size.Width, ClientArea.Y + i);
            ShoesCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Shoes
                });
            };
            i += gap;

            EmblemsCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Emblems:" },
                Visible    = true
            };
            EmblemsCheckBox.Location    = new Point(CheckBoxRightPoint.X - EmblemsCheckBox.Size.Width, ClientArea.Y + i);
            EmblemsCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Emblem
                });
            };
            i += gap;

            WingsCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Wings:" },
                Visible    = true
            };
            WingsCheckBox.Location    = new Point(CheckBoxRightPoint.X - WingsCheckBox.Size.Width, ClientArea.Y + i);
            WingsCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Wings
                });
            };
            i += gap;

            BookLabel = new DXLabel
            {
                Parent     = this,
                ForeColour = Color.White,
                IsControl  = false,
                Text       = "Book:",
            };
            BookLabel.Location = new Point(CheckBoxRightPoint.X - BookLabel.Size.Width - 16, ClientArea.Y + i);

            BookWarriorCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "" },
                Hint       = "Warrior",
                Visible    = true
            };
            BookWarriorCheckBox.Location    = new Point(CheckBoxRightPoint.X - 16, ClientArea.Y + i);
            BookWarriorCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Book, Class = RequiredClass.Warrior
                });
            };

            BookWizardCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "" },
                Hint       = "Wizard",
                Visible    = true
            };
            BookWizardCheckBox.Location    = new Point(CheckBoxRightPoint.X + BookWarriorCheckBox.Size.Width - 16, ClientArea.Y + i);
            BookWizardCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Book, Class = RequiredClass.Wizard
                });
            };

            BookTaoistCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "" },
                Hint       = "Taoist",
                Visible    = true
            };
            BookTaoistCheckBox.Location    = new Point(CheckBoxRightPoint.X + BookWarriorCheckBox.Size.Width + BookWizardCheckBox.Size.Width - 16, ClientArea.Y + i);
            BookTaoistCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Book, Class = RequiredClass.Taoist
                });
            };

            BookAssassinCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "" },
                Hint       = "Assassin",
                Visible    = true
            };
            BookAssassinCheckBox.Location    = new Point(CheckBoxRightPoint.X + BookWarriorCheckBox.Size.Width + BookWizardCheckBox.Size.Width + BookTaoistCheckBox.Size.Width - 16, ClientArea.Y + i);
            BookAssassinCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Book, Class = RequiredClass.Assassin
                });
            };
            i += gap;

            PotionCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Potion:" },
                Visible    = true
            };
            PotionCheckBox.Location    = new Point(CheckBoxRightPoint.X - PotionCheckBox.Size.Width, ClientArea.Y + i);
            PotionCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Consumable
                });
            };
            i += gap;

            OreCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Ore:" },
                Visible    = true
            };
            OreCheckBox.Location    = new Point(CheckBoxRightPoint.X - OreCheckBox.Size.Width, ClientArea.Y + i);
            OreCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupToggle {
                    Type = ItemType.Ore
                });
            };
            i += gap;


            i += gap;
            GradeFilterLabel = 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 Grade Filter:",
            };
            GradeFilterLabel.Location = new Point(ClientArea.Left + 3, ClientArea.Y + i);
            CheckBoxRightPoint        = new Point(GradeFilterLabel.Size.Width, 0);
            i += 22;

            CommonCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Common:" },
                Visible    = true
            };
            CommonCheckBox.Location    = new Point(CheckBoxRightPoint.X - CommonCheckBox.Size.Width, ClientArea.Y + i);
            CommonCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupGradeToggle {
                    Grade = Rarity.Common
                });
            };
            i += gap;

            SuperiorCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Superior:" },
                Visible    = true
            };
            SuperiorCheckBox.Location    = new Point(CheckBoxRightPoint.X - SuperiorCheckBox.Size.Width, ClientArea.Y + i);
            SuperiorCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupGradeToggle {
                    Grade = Rarity.Superior
                });
            };
            i += gap;

            EliteCheckBox = new DXCheckBox
            {
                Parent     = this,
                ForeColour = Color.White,
                Label      = { Text = "Elite:" },
                Visible    = true
            };
            EliteCheckBox.Location    = new Point(CheckBoxRightPoint.X - EliteCheckBox.Size.Width, ClientArea.Y + i);
            EliteCheckBox.MouseClick += (o, e) =>
            {
                CEnvir.Enqueue(new C.CompanionPickupGradeToggle {
                    Grade = Rarity.Elite
                });
            };
            i += gap;
        }
예제 #14
0
        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),
            };
        }
예제 #15
0
        public void PopulateQuests()
        {
            foreach (DXLabel line in Lines)
            {
                line.Dispose();
            }

            Lines.Clear();

            if (!Config.QuestTrackerVisible)
            {
                Visible = false;
                return;
            }

            foreach (QuestInfo quest in GameScene.Game.QuestBox.CurrentTab.Quests)
            {
                ClientUserQuest userQuest = GameScene.Game.QuestLog.First(x => x.Quest == quest);

                if (!userQuest.Track)
                {
                    continue;
                }

                DXLabel label = new DXLabel
                {
                    Text          = quest.QuestName,
                    Parent        = TextPanel,
                    Outline       = true,
                    OutlineColour = Color.Black,
                    IsControl     = false,
                    Location      = new Point(15, Lines.Count * 15)
                };


                DXAnimatedControl QuestIcon = new DXAnimatedControl
                {
                    Parent         = TextPanel,
                    Location       = new Point(2, Lines.Count * 15),
                    Loop           = true,
                    LibraryFile    = LibraryFile.Interface,
                    BaseIndex      = 83,
                    FrameCount     = 2,
                    AnimationDelay = TimeSpan.FromSeconds(1),
                    IsControl      = false,
                };
                label.Disposing += (o, e) =>
                {
                    QuestIcon.Dispose();
                };

                label.LocationChanged += (o, e) =>
                {
                    QuestIcon.Location = new Point(QuestIcon.Location.X, label.Location.Y);
                };

                QuestIcon.BaseIndex = !userQuest.IsComplete ? 85 : 93;


                if (userQuest.IsComplete)
                {
                    label.Text += " (Complete)";
                }

                Lines.Add(label);

                if (userQuest.IsComplete)
                {
                    DXLabel label1 = new DXLabel
                    {
                        Text          = $"Goto {quest.FinishNPC.NPCName} in {quest.FinishNPC.RegionName}",
                        Parent        = TextPanel,
                        ForeColour    = Color.White,
                        Outline       = true,
                        OutlineColour = Color.Black,
                        IsControl     = false,
                        Location      = new Point(25, Lines.Count * 15)
                    };

                    Lines.Add(label1);
                }
                else
                {
                    foreach (QuestTask task in quest.Tasks)
                    {
                        ClientUserQuestTask userTask = userQuest.Tasks.FirstOrDefault(x => x.Task == task);

                        if (userTask != null && userTask.Completed)
                        {
                            continue;
                        }

                        DXLabel label1 = new DXLabel
                        {
                            Text          = GameScene.Game.GetTaskText(task, userQuest),
                            Parent        = TextPanel,
                            ForeColour    = Color.White,
                            Outline       = true,
                            OutlineColour = Color.Black,
                            IsControl     = false,
                            Location      = new Point(25, Lines.Count * 15)
                        };

                        Lines.Add(label1);
                    }
                }
            }


            Visible = Lines.Count > 0;
            UpdateScrollBar();
        }
예제 #16
0
        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,
            };
        }
예제 #17
0
        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;
                }
            }
        }
예제 #18
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);
        }
예제 #19
0
        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 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
        }
예제 #21
0
        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;
            }
        }
예제 #22
0
        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);
        }
예제 #23
0
        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);
            };
        }
예제 #24
0
        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);
        }
예제 #25
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                CheckBoxRightPoint = Point.Empty;

                if (TypeFilterLabel != null)
                {
                    if (!TypeFilterLabel.IsDisposed)
                    {
                        TypeFilterLabel.Dispose();
                    }

                    TypeFilterLabel = null;
                }

                if (GradeFilterLabel != null)
                {
                    if (!GradeFilterLabel.IsDisposed)
                    {
                        GradeFilterLabel.Dispose();
                    }

                    GradeFilterLabel = null;
                }

                if (BookLabel != null)
                {
                    if (!BookLabel.IsDisposed)
                    {
                        BookLabel.Dispose();
                    }

                    BookLabel = null;
                }

                if (WeaponCheckBox != null)
                {
                    if (!WeaponCheckBox.IsDisposed)
                    {
                        WeaponCheckBox.Dispose();
                    }

                    WeaponCheckBox = null;
                }

                if (ArmourCheckBox != null)
                {
                    if (!ArmourCheckBox.IsDisposed)
                    {
                        ArmourCheckBox.Dispose();
                    }

                    ArmourCheckBox = null;
                }

                if (HelmetCheckBox != null)
                {
                    if (!HelmetCheckBox.IsDisposed)
                    {
                        HelmetCheckBox.Dispose();
                    }

                    HelmetCheckBox = null;
                }

                if (ShieldCheckBox != null)
                {
                    if (!ShieldCheckBox.IsDisposed)
                    {
                        ShieldCheckBox.Dispose();
                    }

                    ShieldCheckBox = null;
                }

                if (NecklaceCheckBox != null)
                {
                    if (!NecklaceCheckBox.IsDisposed)
                    {
                        NecklaceCheckBox.Dispose();
                    }

                    NecklaceCheckBox = null;
                }

                if (BraceletCheckBox != null)
                {
                    if (!BraceletCheckBox.IsDisposed)
                    {
                        BraceletCheckBox.Dispose();
                    }

                    BraceletCheckBox = null;
                }

                if (RingCheckBox != null)
                {
                    if (!RingCheckBox.IsDisposed)
                    {
                        RingCheckBox.Dispose();
                    }

                    RingCheckBox = null;
                }

                if (ShoesCheckBox != null)
                {
                    if (!ShoesCheckBox.IsDisposed)
                    {
                        ShoesCheckBox.Dispose();
                    }

                    ShoesCheckBox = null;
                }

                if (BookWarriorCheckBox != null)
                {
                    if (!BookWarriorCheckBox.IsDisposed)
                    {
                        BookWarriorCheckBox.Dispose();
                    }

                    BookWarriorCheckBox = null;
                }

                if (BookWizardCheckBox != null)
                {
                    if (!BookWizardCheckBox.IsDisposed)
                    {
                        BookWizardCheckBox.Dispose();
                    }

                    BookWizardCheckBox = null;
                }

                if (BookTaoistCheckBox != null)
                {
                    if (!BookTaoistCheckBox.IsDisposed)
                    {
                        BookTaoistCheckBox.Dispose();
                    }

                    BookTaoistCheckBox = null;
                }

                if (BookAssassinCheckBox != null)
                {
                    if (!BookAssassinCheckBox.IsDisposed)
                    {
                        BookAssassinCheckBox.Dispose();
                    }

                    BookAssassinCheckBox = null;
                }

                if (PotionCheckBox != null)
                {
                    if (!PotionCheckBox.IsDisposed)
                    {
                        PotionCheckBox.Dispose();
                    }

                    PotionCheckBox = null;
                }

                if (OreCheckBox != null)
                {
                    if (!OreCheckBox.IsDisposed)
                    {
                        OreCheckBox.Dispose();
                    }

                    OreCheckBox = null;
                }

                if (GoldCheckBox != null)
                {
                    if (!GoldCheckBox.IsDisposed)
                    {
                        GoldCheckBox.Dispose();
                    }

                    GoldCheckBox = null;
                }

                if (CommonCheckBox != null)
                {
                    if (!CommonCheckBox.IsDisposed)
                    {
                        CommonCheckBox.Dispose();
                    }

                    CommonCheckBox = null;
                }

                if (EliteCheckBox != null)
                {
                    if (!EliteCheckBox.IsDisposed)
                    {
                        EliteCheckBox.Dispose();
                    }

                    EliteCheckBox = null;
                }

                if (SuperiorCheckBox != null)
                {
                    if (!SuperiorCheckBox.IsDisposed)
                    {
                        SuperiorCheckBox.Dispose();
                    }

                    SuperiorCheckBox = null;
                }
            }
        }
예제 #26
0
        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;
        }
예제 #27
0
        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));
        }
예제 #28
0
        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),
            };
        }
예제 #29
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (ExperienceBar != null)
                {
                    if (!ExperienceBar.IsDisposed)
                    {
                        ExperienceBar.Dispose();
                    }

                    ExperienceBar = null;
                }

                if (NewMailIcon != null)
                {
                    if (!NewMailIcon.IsDisposed)
                    {
                        NewMailIcon.Dispose();
                    }

                    NewMailIcon = null;
                }

                if (ClassLabel != null)
                {
                    if (!ClassLabel.IsDisposed)
                    {
                        ClassLabel.Dispose();
                    }

                    ClassLabel = null;
                }

                if (LevelLabel != null)
                {
                    if (!LevelLabel.IsDisposed)
                    {
                        LevelLabel.Dispose();
                    }

                    LevelLabel = null;
                }

                if (ACLabel != null)
                {
                    if (!ACLabel.IsDisposed)
                    {
                        ACLabel.Dispose();
                    }

                    ACLabel = null;
                }

                if (MRLabel != null)
                {
                    if (!MRLabel.IsDisposed)
                    {
                        MRLabel.Dispose();
                    }

                    MRLabel = null;
                }

                if (DCLabel != null)
                {
                    if (!DCLabel.IsDisposed)
                    {
                        DCLabel.Dispose();
                    }

                    DCLabel = null;
                }

                if (MCLabel != null)
                {
                    if (!MCLabel.IsDisposed)
                    {
                        MCLabel.Dispose();
                    }

                    MCLabel = null;
                }

                if (SCLabel != null)
                {
                    if (!SCLabel.IsDisposed)
                    {
                        SCLabel.Dispose();
                    }

                    SCLabel = null;
                }

                if (AccuracyLabel != null)
                {
                    if (!AccuracyLabel.IsDisposed)
                    {
                        AccuracyLabel.Dispose();
                    }

                    AccuracyLabel = null;
                }

                if (AgilityLabel != null)
                {
                    if (!AgilityLabel.IsDisposed)
                    {
                        AgilityLabel.Dispose();
                    }

                    AgilityLabel = null;
                }

                if (HealthLabel != null)
                {
                    if (!HealthLabel.IsDisposed)
                    {
                        HealthLabel.Dispose();
                    }

                    HealthLabel = null;
                }

                if (ManaLabel != null)
                {
                    if (!ManaLabel.IsDisposed)
                    {
                        ManaLabel.Dispose();
                    }

                    ManaLabel = null;
                }

                if (ExperienceLabel != null)
                {
                    if (!ExperienceLabel.IsDisposed)
                    {
                        ExperienceLabel.Dispose();
                    }

                    ExperienceLabel = null;
                }

                if (AttackModeLabel != null)
                {
                    if (!AttackModeLabel.IsDisposed)
                    {
                        AttackModeLabel.Dispose();
                    }

                    AttackModeLabel = null;
                }

                if (PetModeLabel != null)
                {
                    if (!PetModeLabel.IsDisposed)
                    {
                        PetModeLabel.Dispose();
                    }

                    PetModeLabel = null;
                }
            }
        }
예제 #30
0
        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()
                });
            };
        }