Esempio n. 1
0
        public ChatTab()
        {
            Opacity         = 0.5F;
            DrawOtherBorder = true;

            ScrollBar = new DXVScrollBar
            {
                Parent      = this,
                Size        = new Size(14, Size.Height),
                VisibleSize = Size.Height
            };
            ScrollBar.Location      = new Point(Size.Width - ScrollBar.Size.Width - ResizeBuffer, 0);
            ScrollBar.ValueChanged += (o, e) => UpdateItems();

            TextPanel = new DXControl
            {
                Parent      = this,
                PassThrough = true,
                Location    = new Point(ResizeBuffer, ResizeBuffer),
                Size        = new Size(Size.Width - ScrollBar.Size.Width - 1 - ResizeBuffer * 2, Size.Height - ResizeBuffer * 2),
            };

            AlertIcon = new DXImageControl
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 240,
                Parent      = TabButton,
                IsControl   = false,
                Location    = new Point(2, 2),
                Visible     = false,
            };

            MouseWheel += ScrollBar.DoMouseWheel;
            Tabs.Add(this);
        }
Esempio n. 2
0
        public MiniMapDialog()
        {
            BackColour = Color.Black;
            HasFooter  = false;

            AllowResize         = true;
            CloseButton.Visible = false;

            Size = new Size(200, 200);

            Panel = new DXControl
            {
                Parent   = this,
                Location = Area.Location,
                Size     = Area.Size
            };

            Image = new DXImageControl
            {
                Parent           = Panel,
                LibraryFile      = LibraryFile.MiniMap,
                Movable          = true,
                IgnoreMoveBounds = true,
            };
            GameScene.Game.MapControl.MapInfoChanged += MapControl_MapInfoChanged;
            Image.Moving += Image_Moving;
        }
Esempio n. 3
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                _SelectedInfo       = null;
                SelectedInfoChanged = null;

                Area   = Rectangle.Empty;
                ScaleX = 0;
                ScaleY = 0;

                foreach (KeyValuePair <object, DXControl> pair in MapInfoObjects)
                {
                    if (pair.Value == null)
                    {
                        continue;
                    }
                    if (pair.Value.IsDisposed)
                    {
                        continue;
                    }

                    pair.Value.Dispose();
                }

                MapInfoObjects.Clear();
                MapInfoObjects = null;


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

                    Image = null;
                }

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

                    Panel = null;
                }
            }
        }
Esempio n. 4
0
        public BigMapDialog()
        {
            BackColour = Color.Black;
            HasFooter  = false;

            AllowResize = true;

            Panel = new DXControl
            {
                Parent   = this,
                Location = Area.Location,
                Size     = Area.Size
            };

            Image = new DXImageControl
            {
                Parent      = Panel,
                LibraryFile = LibraryFile.MiniMap,
            };
            Image.MouseClick += Image_MouseClick;
        }
Esempio n. 5
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

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

                    ExperienceBar = null;
                }

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

                    NewMailIcon = null;
                }

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

                    ClassLabel = null;
                }

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

                    LevelLabel = null;
                }

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

                    ACLabel = null;
                }

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

                    MRLabel = null;
                }

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

                    DCLabel = null;
                }

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

                    MCLabel = null;
                }

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

                    SCLabel = null;
                }

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

                    AccuracyLabel = null;
                }

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

                    AgilityLabel = null;
                }

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

                    HealthLabel = null;
                }

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

                    ManaLabel = null;
                }

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

                    ExperienceLabel = null;
                }

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

                    AttackModeLabel = null;
                }

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

                    PetModeLabel = null;
                }
            }
        }
Esempio n. 6
0
        public MainPanel()
        {
            LibraryFile = LibraryFile.GameInter;
            Index       = 50;

            ExperienceBar = new DXImageControl
            {
                Parent      = this,
                LibraryFile = LibraryFile.GameInter,
                Index       = 51,
            };
            ExperienceBar.Location    = new Point((Size.Width - ExperienceBar.Size.Width) / 2 + 1, 2 + 1);
            ExperienceBar.BeforeDraw += (o, e) =>
            {
                if (ExperienceBar.Library == null)
                {
                    return;
                }

                if (MapObject.User.Level >= Globals.ExperienceList.Count)
                {
                    return;
                }

                decimal MaxExperience = Globals.ExperienceList[MapObject.User.Level];

                if (MaxExperience == 0)
                {
                    return;
                }

                //Get percent.
                MirImage image = ExperienceBar.Library.CreateImage(56, ImageType.Image);

                if (image == null)
                {
                    return;
                }

                int x = (ExperienceBar.Size.Width - image.Width) / 2;
                int y = (ExperienceBar.Size.Height - image.Height) / 2;


                float percent = (float)Math.Min(1, Math.Max(0, MapObject.User.Experience / MaxExperience));

                if (percent == 0)
                {
                    return;
                }



                PresentTexture(image.Image, this, new Rectangle(ExperienceBar.DisplayArea.X + x, ExperienceBar.DisplayArea.Y + y - 1, (int)(image.Width * percent), image.Height), Color.White, ExperienceBar);
            };

            DXControl HealthBar = new DXControl
            {
                Parent   = this,
                Location = new Point(35, 22),
                Size     = ExperienceBar.Library.GetSize(52),
            };

            HealthBar.BeforeDraw += (o, e) =>
            {
                if (ExperienceBar.Library == null)
                {
                    return;
                }

                if (MapObject.User.Stats[Stat.Health] == 0)
                {
                    return;
                }

                float percent = Math.Min(1, Math.Max(0, MapObject.User.CurrentHP / (float)MapObject.User.Stats[Stat.Health]));

                if (percent == 0)
                {
                    return;
                }

                MirImage image = ExperienceBar.Library.CreateImage(52, ImageType.Image);

                if (image == null)
                {
                    return;
                }

                PresentTexture(image.Image, this, new Rectangle(HealthBar.DisplayArea.X, HealthBar.DisplayArea.Y, (int)(image.Width * percent), image.Height), Color.White, HealthBar);
            };
            DXControl ManaBar = new DXControl
            {
                Parent   = this,
                Location = new Point(35, 36),
                Size     = ExperienceBar.Library.GetSize(52),
            };

            ManaBar.BeforeDraw += (o, e) =>
            {
                if (ExperienceBar.Library == null)
                {
                    return;
                }

                if (MapObject.User.Stats[Stat.Mana] == 0)
                {
                    return;
                }

                float percent = Math.Min(1, Math.Max(0, MapObject.User.CurrentMP / (float)MapObject.User.Stats[Stat.Mana]));

                if (percent == 0)
                {
                    return;
                }

                MirImage image = ExperienceBar.Library.CreateImage(54, ImageType.Image);

                if (image == null)
                {
                    return;
                }

                PresentTexture(image.Image, this, new Rectangle(ManaBar.DisplayArea.X, ManaBar.DisplayArea.Y, (int)(image.Width * percent), image.Height), Color.White, ManaBar);
            };
            DXImageControl OtherBar = new DXImageControl
            {
                Parent      = this,
                Location    = new Point(35, 50),
                LibraryFile = LibraryFile.GameInter,
                Index       = 58,
                Visible     = false,
            };

            DXButton CharacterButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 82,
                Parent      = this,
                Location    = new Point(650, 23),
                Hint        = "角色 [Q]"
            };

            CharacterButton.MouseClick += (o, e) =>
            {
                GameScene.Game.CharacterBox.Visible = !GameScene.Game.CharacterBox.Visible;
            };

            DXButton InventoryButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 87,
                Parent      = this,
                Location    = new Point(689, 23),
                Hint        = "背包 [W]\n" +
                              "宠物背包 [U]"
            };

            InventoryButton.MouseClick += (o, e) => GameScene.Game.InventoryBox.Visible = !GameScene.Game.InventoryBox.Visible;

            DXButton SpellButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 92,
                Parent      = this,
                Location    = new Point(728, 23),
                Hint        = "技能 [E]"
            };

            SpellButton.MouseClick += (o, e) => GameScene.Game.MagicBox.Visible = !GameScene.Game.MagicBox.Visible;

            DXButton QuestButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 112,
                Parent      = this,
                Location    = new Point(767, 23),
                Hint        = "任务 [J]"
            };

            QuestButton.MouseClick += (o, e) => GameScene.Game.QuestBox.Visible = !GameScene.Game.QuestBox.Visible;

            DXButton MailButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 97,
                Parent      = this,
                Location    = new Point(806, 23),
                Hint        = "邮件 [,]"
            };

            MailButton.MouseClick += (o, e) => GameScene.Game.MailBox.Visible = !GameScene.Game.MailBox.Visible;

            NewMailIcon = new DXImageControl
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 240,
                Parent      = MailButton,
                IsControl   = false,
                Location    = new Point(2, 2),
                Visible     = false,
            };

            AvailableQuestIcon = new DXImageControl
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 240,
                Parent      = QuestButton,
                IsControl   = false,
                Location    = new Point(2, 2),
                Visible     = false,
            };
            AvailableQuestIcon.VisibleChanged += (o, e) =>
            {
                if (AvailableQuestIcon.Visible)
                {
                    CompletedQuestIcon.Location = new Point(2, QuestButton.Size.Height - CompletedQuestIcon.Size.Height);
                }
                else
                {
                    CompletedQuestIcon.Location = new Point(2, 2);
                }
            };

            CompletedQuestIcon = new DXImageControl
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 241,
                Parent      = QuestButton,
                IsControl   = false,
                Location    = new Point(2, 2),
                Visible     = false,
            };

            DXButton BeltButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 107,
                Parent      = this,
                Location    = new Point(845, 23),
                Hint        = "快捷栏 [Z]"
            };

            BeltButton.MouseClick += (o, e) => GameScene.Game.BeltBox.Visible = !GameScene.Game.BeltBox.Visible;

            DXButton GroupButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 102,
                Parent      = this,
                Location    = new Point(884, 23),
                Hint        = "组队 [P]"
            };

            GroupButton.MouseClick += (o, e) => GameScene.Game.GroupBox.Visible = !GameScene.Game.GroupBox.Visible;

            DXButton ConfigButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 117,
                Parent      = this,
                Location    = new Point(923, 23),
                Hint        = "设置 [O]"
            };

            ConfigButton.MouseClick += (o, e) => GameScene.Game.ConfigBox.Visible = !GameScene.Game.ConfigBox.Visible;

            DXButton CashShopButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 122,
                Parent      = this,
                Location    = new Point(972, 16),
                Hint        = "元宝商铺 [Y]"
            };

            CashShopButton.MouseClick += (o, e) =>
            {
                if (GameScene.Game.MarketPlaceBox.StoreTab.IsVisible)
                {
                    GameScene.Game.MarketPlaceBox.Visible = false;
                }
                else
                {
                    GameScene.Game.MarketPlaceBox.Visible = true;
                    GameScene.Game.MarketPlaceBox.StoreTab.TabButton.InvokeMouseClick();
                }
            };

            DXLabel label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "职业",
                Hint   = "职业",
            };

            label.Location = new Point(300 - label.Size.Width, 20);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "等级",
                Hint   = "等级",
            };
            label.Location = new Point(300 - label.Size.Width, 40);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "防御",
            };
            label.Location = new Point(385 - label.Size.Width, 20);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "魔防",
            };
            label.Location = new Point(470 - label.Size.Width, 20);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "攻击",
            };
            label.Location = new Point(385 - label.Size.Width, 40);

            DXLabel MCLabelLabel = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "魔法",
            };

            MCLabelLabel.Location = new Point(470 - MCLabelLabel.Size.Width, 40);

            DXLabel SCLabelLabel = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "道术",
            };

            SCLabelLabel.Location = new Point(470 - SCLabelLabel.Size.Width, 40);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "准确",
                Hint   = "准确",
            };
            label.Location = new Point(567 - label.Size.Width, 20);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "敏捷",
                Hint   = "敏捷",
            };
            label.Location = new Point(567 - label.Size.Width, 40);

            ClassLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(300, 20),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            LevelLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(300, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            ACLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(385, 20),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            MRLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(470, 20),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            DCLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(385, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            MCLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(470, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            MCLabel.VisibleChanged += (o, e) => MCLabelLabel.Visible = MCLabel.Visible;

            SCLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(470, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            SCLabel.VisibleChanged += (o, e) => SCLabelLabel.Visible = SCLabel.Visible;

            AccuracyLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(567, 20),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            AgilityLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(567, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };


            HealthLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            HealthLabel.SizeChanged += (o, e) =>
            {
                HealthLabel.Location = new Point(HealthBar.Location.X + (HealthBar.Size.Width - HealthLabel.Size.Width) / 2, HealthBar.Location.Y + (HealthBar.Size.Height - HealthLabel.Size.Height) / 2);
            };

            ManaLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            ManaLabel.SizeChanged += (o, e) =>
            {
                ManaLabel.Location = new Point(ManaBar.Location.X + (ManaBar.Size.Width - ManaLabel.Size.Width) / 2, ManaBar.Location.Y + (ManaBar.Size.Height - ManaLabel.Size.Height) / 2);
            };


            ExperienceLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            ExperienceLabel.SizeChanged += (o, e) =>
            {
                ExperienceLabel.Location = new Point(ExperienceBar.Location.X + (ExperienceBar.Size.Width - ExperienceLabel.Size.Width) / 2, ExperienceBar.Location.Y + (ExperienceBar.Size.Height - ExperienceLabel.Size.Height) / 2);
            };

            AttackModeLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.Cyan,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            AttackModeLabel.SizeChanged += (o, e) =>
            {
                AttackModeLabel.Location = new Point(OtherBar.Location.X, OtherBar.Location.Y + (OtherBar.Size.Height - AttackModeLabel.Size.Height) / 2 - 2);
            };

            PetModeLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.Cyan,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            PetModeLabel.SizeChanged += (o, e) =>
            {
                PetModeLabel.Location = new Point(OtherBar.Location.X + OtherBar.Size.Width - PetModeLabel.Size.Width, OtherBar.Location.Y + (OtherBar.Size.Height - PetModeLabel.Size.Height) / 2 - 2);
            };
        }
Esempio n. 7
0
        public void Update(MovementInfo ob)
        {
            if (ob.SourceRegion == null || ob.SourceRegion.Map != GameScene.Game.MapControl.MapInfo)
            {
                return;
            }
            if (ob.DestinationRegion?.Map == null || ob.Icon == MapIcon.None)
            {
                return;
            }

            if (ob.SourceRegion.PointList == null)
            {
                ob.SourceRegion.CreatePoints(GameScene.Game.MapControl.Width);
            }

            int minX = GameScene.Game.MapControl.Width, maxX = 0, minY = GameScene.Game.MapControl.Height, maxY = 0;

            foreach (Point point in ob.SourceRegion.PointList)
            {
                if (point.X < minX)
                {
                    minX = point.X;
                }
                if (point.X > maxX)
                {
                    maxX = point.X;
                }

                if (point.Y < minY)
                {
                    minY = point.Y;
                }
                if (point.Y > maxY)
                {
                    maxY = point.Y;
                }
            }

            int x = (minX + maxX) / 2;
            int y = (minY + maxY) / 2;


            DXImageControl control;

            MapInfoObjects[ob] = control = new DXImageControl
            {
                LibraryFile  = LibraryFile.Interface,
                Parent       = Image,
                Opacity      = Opacity,
                ImageOpacity = Opacity,
                Hint         = ob.DestinationRegion.Map.Description,
            };
            control.OpacityChanged += (o, e) => control.ImageOpacity = control.Opacity;

            switch (ob.Icon)
            {
            case MapIcon.Cave:
                control.Index      = 70;
                control.ForeColour = Color.Red;
                break;

            case MapIcon.Exit:
                control.Index      = 70;
                control.ForeColour = Color.Green;
                break;

            case MapIcon.Down:
                control.Index      = 70;
                control.ForeColour = Color.MediumVioletRed;
                break;

            case MapIcon.Up:
                control.Index      = 70;
                control.ForeColour = Color.DeepSkyBlue;
                break;

            case MapIcon.Province:
                control.Index       = 6125;
                control.LibraryFile = LibraryFile.GameInter;
                break;

            case MapIcon.Building:
                control.Index       = 6124;
                control.LibraryFile = LibraryFile.GameInter;
                break;
            }
            //control.MouseClick += (o, e) => SelectedInfo = ob.DestinationRegion.Map;
            control.Location = new Point((int)(ScaleX * x) - control.Size.Width / 2, (int)(ScaleY * y) - control.Size.Height / 2);
        }
Esempio n. 8
0
        public void BuffsChanged()
        {
            foreach (DXImageControl control in Icons.Values)
            {
                control.Dispose();
            }

            Icons.Clear();

            List <ClientBuffInfo> buffs = MapObject.User.Buffs.ToList();

            Stats permStats = new Stats();

            for (int i = buffs.Count - 1; i >= 0; i--)
            {
                ClientBuffInfo buff = buffs[i];

                switch (buff.Type)
                {
                case BuffType.ItemBuff:
                    if (buff.RemainingTime != TimeSpan.MaxValue)
                    {
                        continue;
                    }

                    permStats.Add(Globals.ItemInfoList.Binding.First(x => x.Index == buff.ItemIndex).Stats);

                    buffs.Remove(buff);
                    break;

                case BuffType.Ranking:
                case BuffType.Developer:
                    buffs.Remove(buff);
                    break;
                }
            }

            if (permStats.Count > 0)
            {
                buffs.Add(new ClientBuffInfo {
                    Index = 0, Stats = permStats, Type = BuffType.ItemBuffPermanent, RemainingTime = TimeSpan.MaxValue
                });
            }

            buffs.Sort((x1, x2) => x2.RemainingTime.CompareTo(x1.RemainingTime));



            foreach (ClientBuffInfo buff in buffs)
            {
                DXImageControl icon;
                Icons[buff] = icon = new DXImageControl
                {
                    Parent      = this,
                    LibraryFile = LibraryFile.CBIcon,
                };

                switch (buff.Type)
                {
                case BuffType.Heal:
                    icon.Index = 78;
                    break;

                case BuffType.Invisibility:
                    icon.Index = 74;
                    break;

                case BuffType.MagicResistance:
                    icon.Index = 92;
                    break;

                case BuffType.Resilience:
                    icon.Index = 91;
                    break;

                case BuffType.PoisonousCloud:
                    icon.Index = 98;
                    break;

                case BuffType.Castle:
                    icon.Index = 242;
                    break;

                case BuffType.FullBloom:
                    icon.Index = 162;
                    break;

                case BuffType.WhiteLotus:
                    icon.Index = 163;
                    break;

                case BuffType.RedLotus:
                    icon.Index = 164;
                    break;

                case BuffType.MagicShield:
                    icon.Index = 100;
                    break;

                case BuffType.FrostBite:
                    icon.Index = 221;
                    break;

                case BuffType.ElementalSuperiority:
                    icon.Index = 93;
                    break;

                case BuffType.BloodLust:
                    icon.Index = 90;
                    break;

                case BuffType.Cloak:
                    icon.Index = 160;
                    break;

                case BuffType.GhostWalk:
                    icon.Index = 160;
                    break;

                case BuffType.Observable:
                    icon.Index = 172;
                    break;

                case BuffType.TheNewBeginning:
                    icon.Index = 166;
                    break;

                case BuffType.Veteran:
                    icon.Index = 171;
                    break;

                case BuffType.Brown:
                    icon.Index = 229;
                    break;

                case BuffType.PKPoint:
                    icon.Index = 266;
                    break;

                case BuffType.Redemption:
                    icon.Index = 258;
                    break;

                case BuffType.Renounce:
                    icon.Index = 94;
                    break;

                case BuffType.Defiance:
                    icon.Index = 97;
                    break;

                case BuffType.Might:
                    icon.Index = 96;
                    break;

                case BuffType.ReflectDamage:
                    icon.Index = 98;
                    break;

                case BuffType.Endurance:
                    icon.Index = 95;
                    break;

                case BuffType.JudgementOfHeaven:
                    icon.Index = 99;
                    break;

                case BuffType.StrengthOfFaith:
                    icon.Index = 141;
                    break;

                case BuffType.CelestialLight:
                    icon.Index = 142;
                    break;

                case BuffType.Transparency:
                    icon.Index = 160;
                    break;

                case BuffType.LifeSteal:
                    icon.Index = 98;
                    break;

                case BuffType.DarkConversion:
                    icon.Index = 166;
                    break;

                case BuffType.DragonRepulse:
                    icon.Index = 165;
                    break;

                case BuffType.Evasion:
                    icon.Index = 167;
                    break;

                case BuffType.RagingWind:
                    icon.Index = 168;
                    break;

                case BuffType.MagicWeakness:
                    icon.Index = 182;
                    break;

                case BuffType.ItemBuff:
                    icon.Index = Globals.ItemInfoList.Binding.First(x => x.Index == buff.ItemIndex).BuffIcon;
                    break;

                case BuffType.PvPCurse:
                    icon.Index = 241;
                    break;

                case BuffType.ItemBuffPermanent:
                    icon.Index = 81;
                    break;

                case BuffType.HuntGold:
                    icon.Index = 264;
                    break;

                case BuffType.Companion:
                    icon.Index = 137;
                    break;

                case BuffType.MapEffect:
                    icon.Index = 76;
                    break;

                case BuffType.Guild:
                    icon.Index = 140;
                    break;

                default:
                    icon.Index = 73;
                    break;
                }

                icon.ProcessAction = () =>
                {
                    if (MouseControl == icon)
                    {
                        icon.Hint = GetBuffHint(buff);
                    }
                };
            }

            for (int i = 0; i < buffs.Count; i++)
            {
                Icons[buffs[i]].Location = new Point(3 + (i % 6) * 27, 3 + (i / 6) * 27);
            }

            Size = new Size(3 + Math.Min(6, Math.Max(1, Icons.Count)) * 27, 3 + Math.Max(1, 1 + (Icons.Count - 1) / 6) * 27);
        }
Esempio n. 9
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                Tabs.Remove(this);

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

                    Panel = null;
                }

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

                    TextPanel = null;
                }

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

                    ScrollBar = null;
                }

                if (History != null)
                {
                    for (int i = 0; i < History.Count; i++)
                    {
                        if (History[i] != null)
                        {
                            if (!History[i].IsDisposed)
                            {
                                History[i].Dispose();
                            }

                            History[i] = null;
                        }
                    }

                    History.Clear();
                    History = null;
                }

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

                    AlertIcon = null;
                }
            }
        }