コード例 #1
0
        public override void CreateLabel()
        {
            base.CreateLabel();

            OwnerLabel = null;
            string ownerText = $"{OwnerName}'s Hero";

            for (int i = 0; i < LabelList.Count; i++)
            {
                if (LabelList[i].Text != ownerText || LabelList[i].ForeColour != NameColour)
                {
                    continue;
                }
                OwnerLabel = LabelList[i];
                break;
            }

            if (OwnerLabel != null && !OwnerLabel.IsDisposed)
            {
                return;
            }

            OwnerLabel = new MirLabel
            {
                AutoSize      = true,
                BackColour    = Color.Transparent,
                ForeColour    = NameColour,
                OutLine       = true,
                OutLineColour = Color.Black,
                Text          = ownerText,
            };
            OwnerLabel.Disposing += (o, e) => LabelList.Remove(OwnerLabel);
            LabelList.Add(OwnerLabel);
        }
コード例 #2
0
ファイル: BigMapDialog.cs プロジェクト: NightBakery/mir2
        public WorldMapImage()
        {
            Library    = Libraries.Prguse2;
            Index      = 1360;
            NotControl = false;
            Visible    = false;

            Clouds = new MirImageControl()
            {
                Parent     = this,
                Library    = Libraries.Prguse2,
                Index      = 1365,
                NotControl = true,
                Visible    = true,
                Blending   = true
            };

            Border = new MirImageControl()
            {
                Parent     = this,
                Library    = Libraries.Prguse2,
                Index      = 1366,
                NotControl = true,
                Visible    = true
            };

            TitleLabel = new MirLabel()
            {
                AutoSize   = true,
                BackColour = Color.Black,
                ForeColour = Color.White,
                Parent     = this,
                Visible    = true
            };
        }
コード例 #3
0
        public void LoadKeyBinds()
        {
            if (Shortcuts == null)
            {
                return;
            }

            for (int i = 0; i < Shortcuts.Count; i++)
            {
                MirLabel shortcutLabel = new MirLabel
                {
                    Text       = Shortcuts[i].Shortcut,
                    ForeColour = Color.Yellow,
                    DrawFormat = TextFormatFlags.VerticalCenter,
                    Font       = new Font(Settings.FontName, 9F),
                    Parent     = this,
                    AutoSize   = true,
                    Location   = new Point(18, 107 + (20 * i)),
                    Size       = new Size(95, 23),
                };

                MirLabel informationLabel = new MirLabel
                {
                    Text       = Shortcuts[i].Information,
                    DrawFormat = TextFormatFlags.VerticalCenter,
                    ForeColour = Color.White,
                    Font       = new Font(Settings.FontName, 9F),
                    Parent     = this,
                    AutoSize   = true,
                    Location   = new Point(119, 107 + (20 * i)),
                    Size       = new Size(400, 23),
                };
            }
        }
コード例 #4
0
        public void CreateBossLabel()
        {
            BossLabel = null;

            for (int i = 0; i < LabelList.Count; i++)
            {
                //  Not the same name
                if (LabelList[i].Text.Contains(string.Format("{0}", Name)) ||
                    //  Not the same name color
                    LabelList[i].ForeColour != NameColour)
                {
                    continue;
                }
                BossLabel = LabelList[i];
                break;
            }


            if (BossLabel != null && !BossLabel.IsDisposed)
            {
                return;
            }

            BossLabel = new MirLabel
            {
                AutoSize      = true,
                BackColour    = Color.Transparent,
                ForeColour    = NameColour,
                OutLine       = true,
                OutLineColour = Color.Black,
                Text          = string.Format("{0} - {1}%", Name, PercentHealth),
            };
            BossLabel.Disposing += (o, e) => LabelList.Remove(BossLabel);
            LabelList.Add(BossLabel);
        }
コード例 #5
0
ファイル: Damage.cs プロジェクト: a11874430/Mir2-2
        public void Draw(Point displayLocation)
        {
            long timeRemaining = ExpireTime - CMain.Time;

            if (DamageLabel == null)
            {
                DamageLabel = new MirLabel
                {
                    AutoSize      = true,
                    BackColour    = Color.Transparent,
                    ForeColour    = Colour,
                    OutLine       = true,
                    OutLineColour = Color.Black,
                    Text          = Text,
                    Font          = new Font(Settings.FontName, 10F, FontStyle.Bold)
                };
                DamageLabel.Disposing += label_Disposing;

                MapObject.DamageLabelList.Add(DamageLabel);
            }

            displayLocation.Offset((int)(15 - (Text.Length * 3)), (int)(((int)((double)timeRemaining / Factor)) - Distance) - 75 - Offset);

            DamageLabel.Location = displayLocation;
            DamageLabel.Draw();
        }
コード例 #6
0
        public static void CreateKillChainLabel()
        {
            if (KillChainBaseLabel == null || KillChainBaseLabel.IsDisposed)
            {
                KillChainBaseLabel = new MirControl
                {
                    BackColour         = Color.FromArgb(50, 50, 50),
                    Border             = true,
                    BorderColour       = Color.Black,
                    DrawControlTexture = true,
                    Location           = new Point(5, 500),
                    NotControl         = true,
                    Opacity            = 0.5F
                };
            }

            if (KillChainLabel == null || KillChainLabel.IsDisposed)
            {
                KillChainLabel = new MirLabel
                {
                    AutoSize   = true,
                    BackColour = Color.Transparent,
                    ForeColour = Color.OrangeRed,
                    Parent     = KillChainBaseLabel,
                    Font       = new Font(Settings.FontName, 10F, FontStyle.Bold)
                };

                KillChainLabel.SizeChanged += (o, e) => KillChainBaseLabel.Size = KillChainLabel.Size;
            }

            KillChainLabel.Text = KillChainMessage;
        }
コード例 #7
0
        public ShortcutInfoPage()
        {
            Visible = false;

            MirLabel shortcutTitleLabel = new MirLabel
            {
                Text       = "快捷菜单",
                DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                ForeColour = Color.White,
                Font       = new Font(Settings.FontName, 10F),
                Parent     = this,
                AutoSize   = true,
                Location   = new Point(13, 75),
                Size       = new Size(100, 30)
            };

            MirLabel infoTitleLabel = new MirLabel
            {
                Text       = "信息",
                DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                ForeColour = Color.White,
                Font       = new Font(Settings.FontName, 10F),
                Parent     = this,
                AutoSize   = true,
                Location   = new Point(114, 75),
                Size       = new Size(405, 30)
            };
        }
コード例 #8
0
ファイル: LoginScene.cs プロジェクト: jkloop45/Solution
        static LoginScene()
        {
            Scene = new MirScene
            {
                Size = Settings.ScreenSize,
            };
            Scene.Shown          += Scene_Shown;
            Scene.VisibleChanged += Scene_VisibleChanged;
            Scene.KeyPress       += Scene_KeyPress;

            Background = new MirAnimatedControl
            {
                Animated       = false,
                AnimationCount = 19,
                AnimationDelay = 100,
                Index          = 0,
                Library        = Libraries.ChrSel,
                Loop           = false,
                Parent         = Scene,
            };
            Background.AfterAnimation += new EventHandler(Background_AfterAnimation);

            VersionLabel = new MirLabel
            {
                AutoSize    = true,
                BackColor   = Color.FromArgb(200, 50, 50, 50),
                Border      = true,
                BorderColor = Color.Black,
                Location    = new Point(5, 580),
                Parent      = Background,
                Text        = "Version: " + Application.ProductVersion
            };
        }
コード例 #9
0
 public GuildBoardCell()
 {
     Border       = false;
     BorderColour = Color.Gray;
     BeforeDraw  += new EventHandler(this.Border_BeforeDraw);
     Click       += (o, e) =>
     {
         GuildBoardDialog.SelectBoard = this;
     };
     NameLabel = new MirLabel
     {
         Text       = "text",
         Location   = new Point(11, 0),
         Parent     = this,
         AutoSize   = true,
         DrawFormat = TextFormatFlags.Default,
         Font       = new Font(Settings.FontName, 9f),
         ForeColour = Color.White,
         NotControl = true
     };
     TextLabel = new MirLabel
     {
         Text       = "text",
         Location   = new Point(150, 0),
         Parent     = this,
         AutoSize   = true,
         DrawFormat = TextFormatFlags.Default,
         Font       = new Font(Settings.FontName, 9f),
         ForeColour = Color.White,
         NotControl = true
     };
 }
コード例 #10
0
        public virtual void CreateLabel()
        {
            NameLabel = null;

            for (int i = 0; i < LabelList.Count; i++)
            {
                if (LabelList[i].Text != Name || LabelList[i].ForeColour != NameColour)
                {
                    continue;
                }
                NameLabel = LabelList[i];
                break;
            }


            if (NameLabel != null && !NameLabel.IsDisposed)
            {
                return;
            }

            NameLabel = new MirLabel
            {
                AutoSize      = true,
                BackColour    = Color.Transparent,
                ForeColour    = NameColour,
                OutLine       = true,
                OutLineColour = Color.Black,
                Text          = Name,
            };
            NameLabel.Disposing += (o, e) => LabelList.Remove(NameLabel);
            LabelList.Add(NameLabel);
        }
コード例 #11
0
        public TargetObjectDialog()
        {
            Index    = 8;
            Library  = Libraries.GameUI;
            Location = new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)), 3);

            TargetHP = new MirImageControl
            {
                Index      = 75,
                Library    = Libraries.GameUI,
                Parent     = this,
                Location   = new Point(58, 37),
                NotControl = true,
                DrawImage  = false
            };
            TargetHP.BeforeDraw += TargetHPBeforeDraw;

            TargetNameLabel = new MirLabel
            {
                DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                AutoSize   = true,
                Location   = new Point(100, 18),
                Parent     = this,
            };

            HPLabel = new MirLabel
            {
                DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                AutoSize   = true,
                Location   = new Point(110, 33),
                Parent     = this
            };
        }
コード例 #12
0
 internal static void PotionItemInfo(UserItem I)
 {
     if (I.Info.Health > 0)
     {
         MirLabel HPLabel = new MirLabel
         {
             AutoSize  = true,
             ForeColor = Color.White,
             Location  = new Point(5, ItemLabel.Size.Height + 3),
             OutLine   = false,
             Parent    = ItemLabel,
             Text      = string.Format("Health Restoration: +{0}HP", I.Info.Health)
         };
         ItemLabel.Size = new Size(HPLabel.Size.Width > ItemLabel.Size.Width ? HPLabel.Size.Width : ItemLabel.Size.Width, ItemLabel.Size.Height + HPLabel.Size.Height);
     }
     if (I.Info.Mana > 0)
     {
         MirLabel MPLabel = new MirLabel
         {
             AutoSize  = true,
             ForeColor = Color.White,
             Location  = new Point(5, ItemLabel.Size.Height + 3),
             OutLine   = false,
             Parent    = ItemLabel,
             Text      = string.Format("Mana Restoration: +{0}MP", I.Info.Mana)
         };
         ItemLabel.Size = new Size(MPLabel.Size.Width > ItemLabel.Size.Width ? MPLabel.Size.Width : ItemLabel.Size.Width, ItemLabel.Size.Height + MPLabel.Size.Height);
     }
 }
コード例 #13
0
        internal static void GeneralItemInfo(UserItem I)
        {
            if (I.Info.Weight > 0)
            {
                MirLabel WeightLabel = new MirLabel
                {
                    AutoSize  = true,
                    ForeColor = Color.White,
                    Location  = new Point(5, ItemLabel.Size.Height + 3),
                    OutLine   = false,
                    Parent    = ItemLabel,
                    Text      = string.Format("Weight: {0}", I.Info.Weight)
                };
                ItemLabel.Size = new Size(WeightLabel.Size.Width > ItemLabel.Size.Width ? WeightLabel.Size.Width : ItemLabel.Size.Width, ItemLabel.Size.Height + WeightLabel.Size.Height);
            }

            if (I.Info.StackSize > 1)
            {
                MirLabel CountLabel = new MirLabel
                {
                    AutoSize  = true,
                    ForeColor = Color.White,
                    Location  = new Point(5, ItemLabel.Size.Height + 3),
                    OutLine   = false,
                    Parent    = ItemLabel,
                    Text      = string.Format("Count: {0}/{1}", I.Amount, I.Info.StackSize)
                };

                ItemLabel.Size = new Size(CountLabel.Size.Width > ItemLabel.Size.Width ? CountLabel.Size.Width : ItemLabel.Size.Width, ItemLabel.Size.Height + CountLabel.Size.Height);
            }
        }
コード例 #14
0
        static GameScene()
        {
            Scene = new MirScene
            {
                Size = Settings.ScreenSize
            };

            Scene.BeforeDraw += Scene_BeforeDraw;
            Scene.MouseDown  += Scene_MouseDown;
            Scene.MouseUp    += Scene_MouseUp;
            Scene.MouseMove  += Scene_MouseMove;
            Scene.KeyDown    += Scene_KeyDown;
            Scene.KeyPress   += Scene_KeyPress;
            Scene.AfterDraw  += Scene_AfterDraw;

            for (int I = 0; I < OutputLines.Length; I++)
            {
                OutputLines[I] = new MirLabel
                {
                    AutoSize  = true,
                    BackColor = Color.Transparent,
                    ForeColor = Color.DarkGreen,
                    OutLine   = true,
                    Location  = new Point(20, 50 + I * 13),
                    Font      = new Font("Microsoft Sans Serif", 8F)
                }
            }
            ;

            MainPanel.Create();
            MiniMap.Create();
            ChatPanel.Create();
            BeltPanel.Create();
        }
コード例 #15
0
        public KeybindHeadingRow(string groupName)
        {
            BulletImage = new MirImageControl
            {
                Parent   = this,
                Index    = 201,
                Library  = Libraries.Prguse2,
                Size     = new Size(8, 6),
                Location = new Point(10, 10),
                Visible  = true
            };

            BulletLabel = new MirLabel
            {
                Parent   = this,
                Text     = groupName,
                Size     = new Size(100, 20),
                Location = new Point(20, 5),
                Font     = new Font(Settings.FontName, Settings.FontSize + 1, FontStyle.Bold),
                Visible  = true
            };

            SpacerImage = new MirImageControl
            {
                Parent   = this,
                Index    = 202,
                Library  = Libraries.Prguse2,
                Size     = new Size(3, 464),
                Location = new Point(0, 25),
                Visible  = true
            };
        }
コード例 #16
0
            public ItemRow()
            {
                _itemNameLabel = new MirLabel
                {
                    Size       = new Size(128, 20),
                    Location   = new Point(5, 0),
                    DrawFormat = TextFormatFlags.HorizontalCenter,
                    Parent     = this,
                    NotControl = true,
                };

                _rentingPlayerLabel = new MirLabel
                {
                    Size       = new Size(128, 20),
                    Location   = new Point(137, 0),
                    DrawFormat = TextFormatFlags.HorizontalCenter,
                    Parent     = this,
                    NotControl = true,
                };

                _returnDateLabel = new MirLabel
                {
                    Size       = new Size(128, 20),
                    Location   = new Point(264, 0),
                    DrawFormat = TextFormatFlags.HorizontalCenter,
                    Parent     = this,
                    NotControl = true,
                };
            }
コード例 #17
0
            public AuctionRow()
            {
                Sound = SoundList.ButtonA;

                Size         = new Size(468, 17);
                BorderColour = Color.Lime;

                NameLabel = new MirLabel
                {
                    Size       = new Size(140, 17),
                    DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                    Parent     = this,
                    NotControl = true,
                };
                PriceLabel = new MirLabel
                {
                    Location   = new Point(141, 0),
                    Size       = new Size(178, 17),
                    DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                    Parent     = this,
                    NotControl = true,
                };

                SellerLabel = new MirLabel
                {
                    Location   = new Point(320),
                    Size       = new Size(148, 17),
                    DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                    Parent     = this,
                    NotControl = true,
                };
            }
コード例 #18
0
        public void CreateNPCLabel(string word, int wordOrder)
        {
            TempLabel = null;

            for (int i = 0; i < LabelList.Count; i++)
            {
                if (LabelList[i].Text != word || LabelList[i].ForeColour != (wordOrder == 0 ? NameColour : Color.White))
                {
                    continue;
                }
                TempLabel = LabelList[i];
                break;
            }

            if (TempLabel != null && !TempLabel.IsDisposed)
            {
                return;
            }

            TempLabel = new MirLabel
            {
                AutoSize      = true,
                BackColour    = Color.Transparent,
                ForeColour    = wordOrder == 0 ? NameColour : Color.White,
                OutLine       = true,
                OutLineColour = Color.Black,
                Text          = word,
            };

            TempLabel.Disposing += (o, e) => LabelList.Remove(TempLabel);
            LabelList.Add(TempLabel);
        }
コード例 #19
0
            public CharacterButton()
            {
                Index   = 44; //45 locked
                Library = Libraries.Prguse;
                Sound   = SoundList.ButtonA;

                NameLabel = new MirLabel
                {
                    Location   = new Point(107, 9),
                    Parent     = this,
                    NotControl = true,
                    Size       = new Size(170, 18)
                };

                LevelLabel = new MirLabel
                {
                    Location   = new Point(107, 28),
                    Parent     = this,
                    NotControl = true,
                    Size       = new Size(30, 18)
                };

                ClassLabel = new MirLabel
                {
                    Location   = new Point(178, 28),
                    Parent     = this,
                    NotControl = true,
                    Size       = new Size(100, 18)
                };
            }
コード例 #20
0
        public BigMapDialog()
        {
            //NotControl = true;
            Location = new Point(130, 100);
            //Border = true;
            //BorderColour = Color.Lime;
            BeforeDraw += (o, e) => OnBeforeDraw();
            Sort        = true;


            //loadTonw();
            //加入坐标显示
            pointlab = new MirLabel
            {
                AutoSize   = true,
                ForeColour = Color.White,
                //OutLineColour = Color.Black,
                Parent   = this,
                Location = new Point(2, 2),
                Visible  = true
            };
            //鼠标移动事件监听,鼠标移动的时候,显示坐标变换
            MouseMove += (o, e) => OnMouseMove();
            MouseDown += (o, e) => OnMouseDown(o, e);


            BeforeDraw += (o, e) => OnBeforeDraw();
        }
コード例 #21
0
        private static void CreateDebugLabel()
        {
            if (!Settings.DebugMode)
            {
                return;
            }

            if (DebugBaseLabel == null || DebugBaseLabel.IsDisposed)
            {
                DebugBaseLabel = new MirControl
                {
                    BackColour         = Color.FromArgb(50, 50, 50),
                    Border             = true,
                    BorderColour       = Color.Black,
                    DrawControlTexture = true,
                    Location           = new Point(5, 5),
                    NotControl         = true,
                    Opacity            = 0.5F
                };
            }

            if (DebugTextLabel == null || DebugTextLabel.IsDisposed)
            {
                DebugTextLabel = new MirLabel
                {
                    AutoSize   = true,
                    BackColour = Color.Transparent,
                    ForeColour = Color.White,
                    Parent     = DebugBaseLabel,
                };

                DebugTextLabel.SizeChanged += (o, e) => DebugBaseLabel.Size = DebugTextLabel.Size;
            }


            string text;

            if (MirControl.MouseControl != null)
            {
                text = string.Format("FPS: {0}", FPS);

                if (MirControl.MouseControl is MapControl)
                {
                    text += string.Format(", Co Ords: {0}", MapControl.MapLocation);
                }

                if (MirScene.ActiveScene is GameScene)
                {
                    text += string.Format(", Objects: {0}", MapControl.Objects.Count);
                }
            }
            else
            {
                text = string.Format("FPS: {0}", FPS);
            }


            DebugTextLabel.Text = text;
        }
コード例 #22
0
        public HeroStashDialog()
        {
            Index    = 1688;
            Library  = Libraries.Prguse;
            Visible  = true;
            Location = new System.Drawing.Point(Settings.ScreenWidth / 2 - 160, Settings.ScreenHeight / 2 - 80);

            Label = new MirLabel
            {
                Location   = new Point(140, 5),
                AutoSize   = true,
                Parent     = this,
                BackColour = Color.Transparent,
                ForeColour = Color.Goldenrod,
                Font       = new Font(Settings.FontName, 10F),
                NotControl = true,
                Text       = "Hero Stash",
            };

            CloseButton = new MirButton
            {
                Location     = new Point(330, 4),
                Index        = 360,
                HoverIndex   = 361,
                PressedIndex = 362,
                Library      = Libraries.Prguse2,
                Visible      = true,
                Parent       = this,
                Hint         = "Close"
            };
            CloseButton.Click += (o, e) =>
            {
                if (Visible)
                {
                    Hide();
                }
            };

            Chosen = new HeroIcon()
            {
                Location = new Point(20, 65),
                Visible  = true,
                Parent   = this,
                Enabled  = true,
            };

            for (int i = 0; i < Icons.Length; i++)
            {
                Icons[i] = new HeroIcon()
                {
                    Location = new Point(99 + (i % 4 * 60), 61 + (i / 4 * 41)),
                    Visible  = true,
                    Parent   = this,
                    Border   = true,
                };
                Icons[i].BeforeDraw += HeroStashDialog_BeforeDraw;
            }
        }
コード例 #23
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            Friend    = null;
            NameLabel = null;

            Selected = false;
        }
コード例 #24
0
ファイル: BigMapDialog.cs プロジェクト: NightBakery/mir2
        public BigMapNPCRow(ClientNPCInfo info)
        {
            Info       = info;
            NotControl = false;
            Size       = new Size(140, 25);
            Visible    = false;
            Sound      = SoundList.ButtonA;

            string name = string.Empty;

            if (Info.Name.Contains("_"))
            {
                string[] splitName = Info.Name.Split('_');

                for (int s = 0; s < splitName.Count(); s++)
                {
                    if (splitName[s] == string.Empty)
                    {
                        continue;
                    }
                    if (s == splitName.Count() - 1)
                    {
                        name += splitName[s];
                    }
                    else
                    {
                        name += $"({splitName[s]})";
                    }
                }
            }

            Icon = new MirImageControl
            {
                Index      = info.Icon,
                Library    = Libraries.MapLinkIcon,
                Location   = new Point(1, 1),
                NotControl = true,
                Parent     = this,
                Sound      = SoundList.ButtonA
            };

            NameLabel = new MirLabel
            {
                AutoSize   = true,
                ForeColour = Color.White,
                Location   = new Point(23, 2),
                Parent     = this,
                NotControl = true,
                Text       = name,
                Sound      = SoundList.ButtonA
            };

            MouseWheel    += (o, e) => ParentDialog.BigMap_MouseWheel(o, e);
            ParentChanged += (o, e) => SetParent();
            Click         += (o, e) => Select();
        }
コード例 #25
0
        public void Chat(string text)
        {
            if (ChatLabel != null && !ChatLabel.IsDisposed)
            {
                ChatLabel.Dispose();
                ChatLabel = null;
            }

            const int     chatWidth = 200;
            List <string> chat      = new List <string>();

            string[] output = text.Split('(', ')');
            foreach (var o in output)
            {
                if (!uint.TryParse(o, out uint id))
                {
                    continue;
                }
                var item = GameScene.ItemInfoList.FirstOrDefault(x => x.Index == id);
                if (item != null)
                {
                    text = Functions.ReplaceFirst(text, "(" + o + ")", " " + item.FriendlyName + " ");
                }
            }

            int index = 0;

            for (int i = 1; i < text.Length; i++)
            {
                if (TextRenderer.MeasureText(CMain.Graphics, text.Substring(index, i - index), ChatFont).Width > chatWidth)
                {
                    chat.Add(text.Substring(index, i - index - 1));
                    index = i - 1;
                }
            }
            chat.Add(text.Substring(index, text.Length - index));

            text = chat[0];
            for (int i = 1; i < chat.Count; i++)
            {
                text += string.Format("\n{0}", chat[i]);
            }

            ChatLabel = new MirLabel
            {
                AutoSize      = true,
                BackColour    = Color.Transparent,
                ForeColour    = Color.White,
                OutLine       = true,
                OutLineColour = Color.Black,
                DrawFormat    = TextFormatFlags.HorizontalCenter,
                Text          = text,
            };
            ChatTime = CMain.Time + 5000;
        }
コード例 #26
0
        static void Label_SizeChanged(object sender, EventArgs e)
        {
            MirLabel L = sender as MirLabel;

            if (L == null)
            {
                return;
            }

            L.Location = new Point(50 - (L.Size.Width / 2), L.Location.Y);
        }
コード例 #27
0
            public RankingRow()
            {
                Sound        = SoundList.ButtonA;
                BorderColour = Color.Lime;
                Visible      = false;
                Click       += Inspect;

                RankLabel = new MirLabel
                {
                    Location   = new Point(0, 0),
                    AutoSize   = true,
                    DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                    Parent     = this,
                    NotControl = true,
                };
                NameLabel = new MirLabel
                {
                    Location   = new Point(55, 0),
                    AutoSize   = true,
                    DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                    Parent     = this,
                    NotControl = true,
                };

                ClassLabel = new MirLabel
                {
                    Location   = new Point(150, 0),
                    AutoSize   = true,
                    DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                    Parent     = this,
                    NotControl = true,
                };

                LevelLabel = new MirLabel
                {
                    Location   = new Point(220, 0),
                    AutoSize   = true,
                    DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                    Parent     = this,
                    NotControl = true,
                };

                ViewButton = new MirButton
                {
                    Index        = 805,
                    HoverIndex   = 806,
                    PressedIndex = 807,
                    Library      = Libraries.Title,
                    Location     = new Point(280, 3),
                    Parent       = this,
                    Sound        = SoundList.ButtonA,
                };
                ViewButton.Click += (o, e) => Observe();
            }
コード例 #28
0
ファイル: MainDialogs.cs プロジェクト: wang35777/kkkgame
        private void Label_SizeChanged(object sender, EventArgs e)
        {
            MirLabel l = sender as MirLabel;

            if (l == null)
            {
                return;
            }

            l.Location = new Point(50 - (l.Size.Width / 2), l.Location.Y);
        }
コード例 #29
0
        public GTRow()
        {
            Size = new Size(550, 17);

            Idx = new MirLabel
            {
                Location   = new Point(15, 0),
                AutoSize   = true,
                Parent     = this,
                ForeColour = Color.White,
                NotControl = true,
                BackColour = Color.Transparent,
            };

            GuildOwner = new MirLabel
            {
                Location   = new Point(45, 0),
                AutoSize   = true,
                Parent     = this,
                ForeColour = Color.White,
                NotControl = true,
                BackColour = Color.Transparent,
            };

            OwnerName = new MirLabel
            {
                Location   = new Point(150, 0),
                AutoSize   = true,
                Parent     = this,
                ForeColour = Color.White,
                NotControl = true,
                BackColour = Color.Transparent,
            };

            Status = new MirLabel
            {
                Location   = new Point(365, 0),
                AutoSize   = true,
                Parent     = this,
                ForeColour = Color.White,
                NotControl = true,
                BackColour = Color.Transparent,
            };

            Price = new MirLabel
            {
                Location   = new Point(460, 0),
                AutoSize   = true,
                Parent     = this,
                ForeColour = Color.White,
                NotControl = true,
                BackColour = Color.Transparent,
            };
        }
コード例 #30
0
        public KeybindRow(KeybindOptions option)
        {
            KeyBind defaultBind = CMain.InputKeys.DefaultKeylist.Single(x => x.function == option);
            KeyBind currentBind = CMain.InputKeys.Keylist.Single(x => x.function == option);

            KeyBind = currentBind;

            BindName = new MirLabel
            {
                Parent   = this,
                Size     = new Size(200, 15),
                Location = new Point(0, 0),
                Text     = defaultBind.Description,
                Visible  = true
            };

            DefaultBind = new MirLabel
            {
                Parent   = this,
                Size     = new Size(100, 15),
                Location = new Point(200, 0),
                Text     = CMain.InputKeys.GetKey(option, true),
                Visible  = true
            };

            CurrentBindButton = new MirButton
            {
                Parent       = this,
                Text         = string.Format("  {0}", CMain.InputKeys.GetKey(option, false)),
                Location     = new Point(340, 0),
                Size         = new Size(120, 16),
                Visible      = true,
                Index        = 190,
                Library      = Libraries.Prguse2,
                HoverIndex   = 191,
                PressedIndex = 192
            };
            CurrentBindButton.Click += (o, e) =>
            {
                if (GameScene.Scene.KeyboardLayoutDialog.WaitingForBind != null)
                {
                    GameScene.Scene.KeyboardLayoutDialog.WaitingForBind = null;
                    GameScene.Scene.KeyboardLayoutDialog.UpdateText();
                    return;
                }

                GameScene.Scene.KeyboardLayoutDialog.WaitingForBind = KeyBind;

                ((MirButton)o).Text         = string.Format("  {0}", "????");
                ((MirButton)o).Index        = 192;
                ((MirButton)o).HoverIndex   = 192;
                ((MirButton)o).PressedIndex = 192;
            };
        }