Esempio n. 1
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);
            }
        }
Esempio n. 2
0
        private void FillOpponentsGroup()
        {
            DXCheckBox civilizationCheckBox;
            GameRoot   root = GameRoot.Instance;
            int        y    = 170;
            int        x    = 300;

            this.civilizationCheckBoxes = new List <DXCheckBox>();

            foreach (Civilization civilization in root.Ruleset.Civilizations)
            {
                if (y >= 400)
                {
                    y = 170;
                    x = 400;
                }
                civilizationCheckBox           = new DXCheckBox(this.ControlHost, this);
                civilizationCheckBox.Font      = LabelFont;
                civilizationCheckBox.Text      = civilization.Name;
                civilizationCheckBox.Tag       = civilization;
                civilizationCheckBox.ForeColor = LabelColor;
                civilizationCheckBox.Size      = new Size(250, 20);
                civilizationCheckBox.Location  = new Point(x, y);
                this.Controls.Add(civilizationCheckBox);
                y += 20;
                this.civilizationCheckBoxes.Add(civilizationCheckBox);
            }
        }
Esempio n. 3
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;
                }
            }
        }
Esempio n. 4
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);
            }
        }
Esempio n. 5
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;
                }
            }
        }
Esempio n. 6
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;
        }
Esempio n. 7
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

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

                    NameTextBox = null;
                }

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

                    RemoveButton = null;
                }

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

                    TransparentCheckBox = null;
                }

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

                    AlertCheckBox = null;
                }

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

                    LocalCheckBox = null;
                }

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

                    WhisperCheckBox = null;
                }

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

                    GroupCheckBox = null;
                }

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

                    GuildCheckBox = null;
                }

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

                    ShoutCheckBox = null;
                }

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

                    GlobalCheckBox = null;
                }

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

                    ObserverCheckBox = null;
                }

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

                    SystemCheckBox = null;
                }

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

                    GainsCheckBox = null;
                }

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

                    HintCheckBox = null;
                }
            }
        }
Esempio n. 8
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),
            };
        }
        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),
            };
        }
Esempio n. 10
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);
        }
Esempio n. 11
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);
        }
Esempio n. 12
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);
        }
        public CompanionDialog()
        {
            TitleLabel.Text = "Companion";
            SetClientSize(new Size(352, 441));

            CompanionDisplayPoint = new Point(ClientArea.X + 60, ClientArea.Y + 50);

            InventoryGrid = new DXItemGrid
            {
                GridSize = new Size(10, 4),
                Parent   = this,
                GridType = GridType.CompanionInventory,
                Location = new Point(ClientArea.X, ClientArea.Y + 300),
            };

            EquipmentGrid = new DXItemCell[Globals.CompanionEquipmentSize];
            DXItemCell cell;

            EquipmentGrid[(int)CompanionSlot.Bag] = cell = new DXItemCell
            {
                Location    = new Point(ClientArea.X + 196, ClientArea.Y + 5),
                Parent      = this,
                FixedBorder = true,
                Border      = true,
                Slot        = (int)CompanionSlot.Bag,
                GridType    = GridType.CompanionEquipment,
            };
            cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 99);

            EquipmentGrid[(int)CompanionSlot.Head] = cell = new DXItemCell
            {
                Location    = new Point(ClientArea.X + 236, ClientArea.Y + 5),
                Parent      = this,
                FixedBorder = true,
                Border      = true,
                Slot        = (int)CompanionSlot.Head,
                GridType    = GridType.CompanionEquipment,
            };
            cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 100);

            EquipmentGrid[(int)CompanionSlot.Back] = cell = new DXItemCell
            {
                Location    = new Point(ClientArea.X + 276, ClientArea.Y + 5),
                Parent      = this,
                FixedBorder = true,
                Border      = true,
                Slot        = (int)CompanionSlot.Back,
                GridType    = GridType.CompanionEquipment,
            };
            cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 101);

            EquipmentGrid[(int)CompanionSlot.Food] = cell = new DXItemCell
            {
                Location    = new Point(ClientArea.X + 316, ClientArea.Y + 5),
                Parent      = this,
                FixedBorder = true,
                Border      = true,
                Slot        = (int)CompanionSlot.Food,
                GridType    = GridType.CompanionEquipment,
            };
            cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 102);

            DXCheckBox PickUpCheckBox = new DXCheckBox
            {
                Parent  = this,
                Label   = { Text = "Pick up items:" },
                Visible = false
            };

            PickUpCheckBox.Location = new Point(ClientArea.Right - PickUpCheckBox.Size.Width + 3, ClientArea.Y + 45);

            DXButton ConfigButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 116,
                Parent      = this,
            };

            ConfigButton.Location    = new Point(ClientArea.X + 2, ClientArea.Y + 5);
            ConfigButton.MouseClick += (o, e) => GameScene.Game.CompanionOptionsBox.Visible = !GameScene.Game.CompanionOptionsBox.Visible;

            /*
             * new DXLabel
             * {
             *  AutoSize = false,
             *  Parent = this,
             *  Outline = true,
             *  Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
             *  ForeColour = Color.FromArgb(198, 166, 99),
             *  OutlineColour = Color.Black,
             *  IsControl = false,
             *  Text = "Abilities",
             *  Location = new Point(ClientArea.X + 196, CompanionDisplayPoint.Y - 20),
             *  Size = new Size(156, 20),
             *  DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
             * };
             */

            DXLabel label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 3",
            };

            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y);

            Level3Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 3),
                Text          = "Not Available"
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 5",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 20);

            Level5Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 23),
                Text          = "Not Available"
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 7",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 40);

            Level7Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 43),
                Text          = "Not Available"
            };


            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 10",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 60);

            Level10Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 63),
                Text          = "Not Available"
            };


            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 11",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 80);

            Level11Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 83),
                Text          = "Not Available"
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 13",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 100);

            Level13Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 103),
                Text          = "Not Available"
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 15",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 120);

            Level15Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 123),
                Text          = "Not Available"
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 17",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 140);

            Level17Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 143),
                Text          = "Not Available"
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 19",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 160);

            Level19Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 163),
                Text          = "Not Available"
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 21",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 180);

            Level21Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 183),
                Text          = "Not Available"
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 23",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 200);

            Level23Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 203),
                Text          = "Not Available"
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 25",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 220);

            Level25Label = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 223),
                Text          = "Not Available"
            };

            NameLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 43)
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Name",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 40);

            LevelLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 63)
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 60);

            ExperienceLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 83)
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Experience",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 80);

            HungerLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 103)
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Hunger",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 100);

            WeightLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 123)
            };

            label = new DXLabel
            {
                Parent        = this,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Weight",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 120);

            VisibleChanged += (o, e) =>
            {
                if (GameScene.Game.CompanionOptionsBox != null)
                {
                    GameScene.Game.CompanionOptionsBox.Visible = false;
                }
            };
        }
        public AutoPotionDialog()
        {
            TitleLabel.Text = "辅助功能";
            HasFooter       = true;

            SetClientSize(new Size(280, 418));


            // feature: 设置tag,用作自动喝药,辅助功能,挂机的分页
            HasTitle          = true;
            SupportTabControl = new DXTabControl
            {
                Parent   = this,
                Location = ClientArea.Location,
                Size     = ClientArea.Size,
            };

            AutoPotionTab = new DXTab
            {
                Parent    = SupportTabControl,
                Border    = true,
                TabButton = { Label = { Text = "自动喝药设置" } },
            };
            AutoSkillTab = new DXTab
            {
                Parent    = SupportTabControl,
                Border    = true,
                TabButton = { Label = { Text = "技能设置" } },
            };
            AutoBattleTab = new DXTab
            {
                Parent    = SupportTabControl,
                Border    = true,
                TabButton = { Label = { Text = "挂机设置" } },
            };

            SupportTabControl.SelectedTab = AutoPotionTab;

            WarriorSkillPanel = new DXControl
            {
                Parent       = AutoSkillTab,
                Border       = true,
                BorderSize   = 3,
                BorderColour = Color.FromArgb(198, 166, 99),
                Size         = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度
                Location     = new Point(3, 10),
            };

            WarriorSkillPanelTitle = new DXLabel
            {
                Parent     = WarriorSkillPanel,
                ForeColour = Color.FromArgb(198, 166, 99),
                Location   = new Point(5, 5),
                Text       = "战士技能"
            };

            AutoBladeStormSkillCheckBox = new DXCheckBox
            {
                Parent   = WarriorSkillPanel,
                Label    = { Text = "自动莲月" },
                Checked  = false,
                Location = new Point(5, WarriorSkillPanelTitle.Size.Height + 5)
            };

            AutoFlamingSwordSkillCheckBox = new DXCheckBox
            {
                Parent   = WarriorSkillPanel,
                Label    = { Text = "自动烈火" },
                Checked  = false,
                Location = new Point(WarriorSkillPanel.Size.Width / 2 + 5, WarriorSkillPanelTitle.Size.Height + 5)
            };

            AutoMightSkillCheckBox = new DXCheckBox
            {
                Parent   = WarriorSkillPanel,
                Label    = { Text = "自动破血狂杀" },
                Checked  = false,
                Location = new Point(5, WarriorSkillPanelTitle.Size.Height + 23)
            };

            WizardSkillPanel = new DXControl
            {
                Parent       = AutoSkillTab,
                Border       = true,
                BorderSize   = 3,
                BorderColour = Color.FromArgb(198, 166, 99),
                Size         = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度
                Location     = new Point(3, 90),
            };

            WizardSkillPanelTitle = new DXLabel
            {
                Parent     = WizardSkillPanel,
                ForeColour = Color.FromArgb(198, 166, 99),
                Location   = new Point(5, 5),
                Text       = "法师技能"
            };

            AutoMagicShieldSkillCheckBox = new DXCheckBox
            {
                Parent   = WizardSkillPanel,
                Label    = { Text = "自动魔法盾" },
                Checked  = false,
                Location = new Point(5, WizardSkillPanelTitle.Size.Height + 5)
            };

            AutoRenounceSkillCheckBox = new DXCheckBox
            {
                Parent   = WizardSkillPanel,
                Label    = { Text = "自动凝血离魄" },
                Checked  = false,
                Location = new Point(WizardSkillPanel.Size.Width / 2 + 5, WizardSkillPanelTitle.Size.Height + 5)
            };

            TaoistSkillPanel = new DXControl
            {
                Parent       = AutoSkillTab,
                Border       = true,
                BorderSize   = 3,
                BorderColour = Color.FromArgb(198, 166, 99),
                Size         = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度
                Location     = new Point(3, 170),
            };

            TaoistSkillPanelTitle = new DXLabel
            {
                Parent     = TaoistSkillPanel,
                ForeColour = Color.FromArgb(198, 166, 99),
                Location   = new Point(5, 5),
                Text       = "道士技能"
            };


            AutoCelestialLightSkillCheckBox = new DXCheckBox
            {
                Parent   = TaoistSkillPanel,
                Label    = { Text = "自动阴阳法环" },
                Checked  = false,
                Location = new Point(5, TaoistSkillPanelTitle.Size.Height + 5)
            };


            AssassinSkillPanel = new DXControl
            {
                Parent       = AutoSkillTab,
                Border       = true,
                BorderSize   = 3,
                BorderColour = Color.FromArgb(198, 166, 99),
                Size         = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度
                Location     = new Point(3, 250),
            };

            AssassinSkillPanelTitle = new DXLabel
            {
                Parent     = AssassinSkillPanel,
                ForeColour = Color.FromArgb(198, 166, 99),
                Location   = new Point(5, 5),
                Text       = "刺客技能"
            };

            AutoFourFlowerSkillCheckBox = new DXCheckBox
            {
                Parent   = AssassinSkillPanel,
                Label    = { Text = "自动四花" },
                Checked  = false,
                Location = new Point(5, AssassinSkillPanelTitle.Size.Height + 5)
            };

            AutoRagingWindSkillCheckBox = new DXCheckBox
            {
                Parent   = AssassinSkillPanel,
                Label    = { Text = "自动风之守护" },
                Checked  = false,
                Location = new Point(AssassinSkillPanel.Size.Width / 2 + 5, AssassinSkillPanelTitle.Size.Height + 5)
            };

            AutoEvasionSkillCheckBox = new DXCheckBox
            {
                Parent   = AssassinSkillPanel,
                Label    = { Text = "自动风之闪避" },
                Checked  = false,
                Location = new Point(5, AssassinSkillPanelTitle.Size.Height + 23)
            };
            // feature end

            Links = new ClientAutoPotionLink[Globals.MaxAutoPotionCount];
            Rows  = new AutoPotionRow[Globals.MaxAutoPotionCount];


            ScrollBar = new DXVScrollBar
            {
                Parent      = AutoPotionTab,
                Size        = new Size(14, AutoPotionTab.Size.Height - 2),
                Location    = new Point(AutoPotionTab.Size.Width - 14, ClientArea.Top + 1),
                VisibleSize = AutoPotionTab.Size.Height,
                MaxValue    = Rows.Length * 50 - 2
            };
            DXControl panel = new DXControl
            {
                Parent   = AutoPotionTab,
                Size     = new Size(AutoPotionTab.Size.Width - 16, AutoPotionTab.Size.Height),
                Location = AutoPotionTab.Location,
            };

            panel.MouseWheel += ScrollBar.DoMouseWheel;

            for (int i = 0; i < Links.Length; i++)
            {
                AutoPotionRow row;
                Rows[i] = row = new AutoPotionRow
                {
                    Parent   = panel,
                    Location = new Point(1, 1 + 50 * i),
                    Index    = i,
                };
                row.MouseWheel += ScrollBar.DoMouseWheel;
            }
            ScrollBar.ValueChanged += (o, e) => UpdateLocations();
        }
Esempio n. 15
0
        private void InitializeComponent()
        {
            //this
            this.BackColor  = Color.DarkGoldenrod;
            this.BackColor2 = Color.LightGoldenrodYellow;
            this.Text       = DirectXClientResources.PlayerSetupTitle;

            //lblLeaderName
            this.lblLeaderName           = new DXLabel(this.ControlHost, this);
            this.lblLeaderName.Text      = DirectXClientResources.LeaderNameLabel;
            this.lblLeaderName.Location  = new Point(10, 80);
            this.lblLeaderName.Font      = LabelFont;
            this.lblLeaderName.ForeColor = LabelColor;
            this.lblLeaderName.AutoSize  = true;
            this.Controls.Add(this.lblLeaderName);

            //txtLeaderName
            this.txtLeaderName          = new DXTextBox(this.ControlHost, this);
            this.txtLeaderName.Font     = LabelFont;
            this.txtLeaderName.Location = new Point(100, 80);
            this.txtLeaderName.Size     = new Size(150, 20);
            this.Controls.Add(this.txtLeaderName);

            //lblCiv
            this.lblCiv           = new DXLabel(this.ControlHost, this);
            this.lblCiv.Text      = DirectXClientResources.CivilizationLabel;
            this.lblCiv.Location  = new Point(10, 110);
            this.lblCiv.Font      = LabelFont;
            this.lblCiv.ForeColor = LabelColor;
            this.lblCiv.AutoSize  = true;
            this.Controls.Add(this.lblCiv);

            //cboCivilization
            this.cboCivilization = new DXComboBox(this.ControlHost, this);
            this.cboCivilization.SelectedIndexChanged += new EventHandler(CivilizationChanged);
            this.cboCivilization.Location              = new Point(100, 110);
            this.cboCivilization.Size          = new Size(150, 20);
            this.cboCivilization.DataSource    = ClientApplication.Instance.ServerInstance.Ruleset.Civilizations;
            this.cboCivilization.DisplayMember = "Name";
            this.Controls.Add(this.cboCivilization);

            //lblDifficulty
            this.lblDifficulty           = new DXLabel(this.ControlHost, this);
            this.lblDifficulty.Text      = DirectXClientResources.DifficultyLabel;
            this.lblDifficulty.Location  = new Point(10, 140);
            this.lblDifficulty.Font      = LabelFont;
            this.lblDifficulty.ForeColor = LabelColor;
            this.lblDifficulty.AutoSize  = true;
            this.Controls.Add(this.lblDifficulty);

            //cboDifficulty
            this.cboDifficulty            = new DXComboBox(this.ControlHost, this);
            this.cboDifficulty.Location   = new Point(100, 140);
            this.cboDifficulty.Size       = new Size(150, 20);
            this.cboDifficulty.DataSource = CreateDifficultyList();
            this.Controls.Add(this.cboDifficulty);

            //lblRules
            this.lblRules           = new DXLabel(this.ControlHost, this);
            this.lblRules.Text      = DirectXClientResources.RulesLabel;
            this.lblRules.Location  = new Point(10, 170);
            this.lblRules.Font      = LabelFont;
            this.lblRules.ForeColor = LabelColor;
            this.lblRules.AutoSize  = true;
            this.Controls.Add(this.lblRules);

            //chkAllowDomination
            this.chkAllowDomination           = new DXCheckBox(this.ControlHost, this);
            this.chkAllowDomination.Location  = new Point(10, 200);
            this.chkAllowDomination.Text      = DirectXClientResources.RuleDominationVictory;
            this.chkAllowDomination.BackColor = Color.White;
            this.chkAllowDomination.Font      = LabelFont;
            this.chkAllowDomination.ForeColor = LabelColor;
            this.chkAllowDomination.Size      = new Size(200, 20);
            this.Controls.Add(this.chkAllowDomination);

            //chkAllowDiplomaticVictory
            this.chkAllowDiplomaticVictory           = new DXCheckBox(this.ControlHost, this);
            this.chkAllowDiplomaticVictory.Location  = new Point(10, 220);
            this.chkAllowDiplomaticVictory.Text      = DirectXClientResources.RuleDiplomaticVictory;
            this.chkAllowDiplomaticVictory.Font      = LabelFont;
            this.chkAllowDiplomaticVictory.BackColor = Color.White;
            this.chkAllowDiplomaticVictory.ForeColor = LabelColor;
            this.chkAllowDiplomaticVictory.Size      = new Size(200, 20);
            this.Controls.Add(this.chkAllowDiplomaticVictory);

            //chkAllowCulturalVictory
            this.chkAllowCulturalVictory           = new DXCheckBox(this.ControlHost, this);
            this.chkAllowCulturalVictory.Location  = new Point(10, 240);
            this.chkAllowCulturalVictory.Text      = DirectXClientResources.RuleCulturalVictory;
            this.chkAllowCulturalVictory.BackColor = Color.White;
            this.chkAllowCulturalVictory.Font      = LabelFont;
            this.chkAllowCulturalVictory.ForeColor = LabelColor;
            this.chkAllowCulturalVictory.Size      = new Size(200, 20);
            this.Controls.Add(this.chkAllowCulturalVictory);

            //chkAllowSpaceVictory
            this.chkAllowSpaceVictory           = new DXCheckBox(this.ControlHost, this);
            this.chkAllowSpaceVictory.Location  = new Point(10, 260);
            this.chkAllowSpaceVictory.Text      = DirectXClientResources.RuleSpaceVictory;
            this.chkAllowSpaceVictory.BackColor = Color.White;
            this.chkAllowSpaceVictory.Font      = LabelFont;
            this.chkAllowSpaceVictory.ForeColor = LabelColor;
            this.chkAllowSpaceVictory.Size      = new Size(200, 20);
            this.Controls.Add(this.chkAllowSpaceVictory);

            //chkAllowMilitaryVictory
            this.chkAllowMilitaryVictory           = new DXCheckBox(this.ControlHost, this);
            this.chkAllowMilitaryVictory.Location  = new Point(10, 280);
            this.chkAllowMilitaryVictory.Text      = DirectXClientResources.RuleMilitaryVictory;
            this.chkAllowMilitaryVictory.BackColor = Color.White;
            this.chkAllowMilitaryVictory.Font      = LabelFont;
            this.chkAllowMilitaryVictory.ForeColor = LabelColor;
            this.chkAllowMilitaryVictory.Size      = new Size(200, 20);
            this.Controls.Add(this.chkAllowMilitaryVictory);

            //chkAllowSpecificAbilities
            this.chkAllowSpecificAbilities           = new DXCheckBox(this.ControlHost, this);
            this.chkAllowSpecificAbilities.Location  = new Point(10, 300);
            this.chkAllowSpecificAbilities.Text      = DirectXClientResources.RuleCivilizationAbilities;
            this.chkAllowSpecificAbilities.Font      = LabelFont;
            this.chkAllowSpecificAbilities.ForeColor = LabelColor;
            this.chkAllowSpecificAbilities.BackColor = Color.White;
            this.chkAllowSpecificAbilities.Size      = new Size(200, 20);
            this.Controls.Add(this.chkAllowSpecificAbilities);

            //chkStandardRules
            this.chkStandardRules           = new DXCheckBox(this.ControlHost, this);
            this.chkStandardRules.Location  = new Point(10, 320);
            this.chkStandardRules.Text      = DirectXClientResources.RuleStandard;
            this.chkStandardRules.Font      = LabelFont;
            this.chkStandardRules.BackColor = Color.White;
            this.chkStandardRules.ForeColor = LabelColor;
            this.chkStandardRules.Size      = new Size(200, 20);
            this.Controls.Add(this.chkStandardRules);

            //lblOpponents
            this.lblOpponents           = new DXLabel(this.ControlHost, this);
            this.lblOpponents.Location  = new Point(300, 140);
            this.lblOpponents.Text      = DirectXClientResources.OpponentsLabel;
            this.lblOpponents.Font      = LabelFont;
            this.lblOpponents.ForeColor = LabelColor;
            this.lblOpponents.AutoSize  = true;
            this.Controls.Add(this.lblOpponents);
        }