public MirGoodsCell() { Size = new Size(205, 32); BorderColour = Color.Lime; NameLabel = new MirLabel { AutoSize = true, Parent = this, NotControl = true, Location = new Point(44, 0), }; CountLabel = new MirLabel { AutoSize = true, Parent = this, NotControl = true, DrawControlTexture = true, Location = new Point(23, 17), ForeColour = Color.Yellow, }; PriceLabel = new MirLabel { AutoSize = true, Parent = this, NotControl = true, Location = new Point(44, 14), }; BeforeDraw += (o, e) => Update(); AfterDraw += (o, e) => DrawItem(); }
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); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (!disposing) { return; } Label = null; OKButton = null; CancelButton = null; NoButton = null; YesButton = null; Buttons = 0; for (int i = 0; i < Program.Form.Controls.Count; i++) { TextBox T = (TextBox)Program.Form.Controls[i]; if (T != null && T.Tag != null) { ((MirTextBox)T.Tag).DialogChanged(); } } }
public bool usePearls = false;//pearl currency public MirGoodsCell() { Size = new Size(205, 32); BorderColour = Color.Lime; NameLabel = new MirLabel { AutoSize = true, Parent = this, NotControl = true, Location = new Point(44, 0), }; CountLabel = new MirLabel { AutoSize = true, Parent = this, NotControl = true, DrawControlTexture = true, Location = new Point(23, 17), ForeColour = Color.Yellow, }; PriceLabel = new MirLabel { AutoSize = true, Parent = this, NotControl = true, Location = new Point(44, 14), }; BeforeDraw += (o, e) => Update(); AfterDraw += (o, e) => DrawItem(); }
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(); }
private void DisposeCountLabel() { if (CountLabel != null && !CountLabel.IsDisposed) { CountLabel.Dispose(); } CountLabel = null; }
public MirButton() { HoverIndex = -1; PressedIndex = -1; Sound = SoundList.ButtonB; _label = new MirLabel { NotControl = true, Parent = this, }; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (!disposing) { return; } if (_label != null && !_label.IsDisposed) { _label.Dispose(); } _label = null; if (_DropDownButton != null && !_DropDownButton.IsDisposed) { _DropDownButton.Dispose(); } _DropDownButton = null; if (_ScrollBar != null && !_ScrollBar.IsDisposed) { _ScrollBar.Dispose(); } _ScrollBar = null; if (_ScrollDown != null && !_ScrollDown.IsDisposed) { _ScrollDown.Dispose(); } _ScrollDown = null; if (_ScrollPosition != null && !_ScrollPosition.IsDisposed) { _ScrollPosition.Dispose(); } _ScrollPosition = null; if (_ScrollUp != null && !_ScrollUp.IsDisposed) { _ScrollUp.Dispose(); } _ScrollUp = null; for (int i = 0; i < _Option.Length; i++) { if (_Option[i] != null && !_Option[i].IsDisposed) { _Option[i].Dispose(); } _Option[i] = null; } }
public MirInputBox(string message) { Modal = true; Movable = false; Index = 660; Library = Libraries.CustomPrguse; Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2); CaptionLabel = new MirLabel { DrawFormat = TextFormatFlags.WordBreak, Location = new Point(25, 25), Size = new Size(235, 40), Parent = this, Text = message, }; InputTextBox = new MirTextBox { Parent = this, Border = true, BorderColour = Color.Lime, Location = new Point(23, 86), Size = new Size(240, 19), MaxLength = 50, }; InputTextBox.SetFocus(); InputTextBox.TextBox.KeyPress += MirInputBox_KeyPress; OKButton = new MirButton { HoverIndex = 201, Index = 200, Library = Libraries.CustomTitle, Location = new Point(60, 123), Parent = this, PressedIndex = 202, }; CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.CustomTitle, Location = new Point(160, 123), Parent = this, PressedIndex = 205, }; CancelButton.Click += DisposeDialog; }
public MirInputBox(string message) { Modal = true; Movable = false; Index = 660; Library = Libraries.Prguse; Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2); CaptionLabel = new MirLabel { DrawFormat = TextFormatFlags.WordBreak, Location = new Point(25, 25), Size = new Size(235, 40), Parent = this, Text = message, }; InputTextBox = new MirTextBox { Parent = this, Border = true, BorderColour = Color.Lime, Location = new Point(23, 86), Size = new Size(240, 19), MaxLength = 50, }; InputTextBox.SetFocus(); InputTextBox.TextBox.KeyPress += MirInputBox_KeyPress; OKButton = new MirButton { HoverIndex = 201, Index = 200, Library = Libraries.Title, Location = new Point(60, 123), Parent = this, PressedIndex = 202, }; CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.Title, Location = new Point(160, 123), Parent = this, PressedIndex = 205, }; CancelButton.Click += DisposeDialog; }
public MirButton() { _HoverIndex = -1; _PressedIndex = -1; _Sound = SoundList.ClickB; Label = new MirLabel { DrawFormat = DrawTextFormat.Center | DrawTextFormat.VerticalCenter, NotControl = true, Parent = this, }; }
public LoginScene() { SoundManager.PlaySound(SoundList.IntroMusic, true); Disposing += (o, e) => SoundManager.StopSound(SoundList.IntroMusic); _background = new MirAnimatedControl { Animated = false, AnimationCount = 19, AnimationDelay = 100, Index = 0, Library = Libraries.ChrSel, Loop = false, Parent = this, }; _login = new LoginDialog {Parent = _background, Visible = false}; _login.AccountButton.Click += (o, e) => { _login.Hide(); _account = new NewAccountDialog { Parent = _background }; _account.Disposing += (o1, e1) => _login.Show(); }; _login.PassButton.Click += (o, e) => { _login.Hide(); _password = new ChangePasswordDialog { Parent = _background }; _password.Disposing += (o1, e1) => _login.Show(); }; Version = new MirLabel { AutoSize = true, BackColour = Color.FromArgb(200, 50, 50, 50), Border = true, BorderColour = Color.Black, Location = new Point(5, 580), Parent = _background, Text = string.Format("Version: {0}", Application.ProductVersion), }; _connectBox = new MirMessageBox("Attempting to connect to the server.", MirMessageBoxButtons.Cancel); _connectBox.CancelButton.Click += (o, e) => Program.Form.Close(); Shown += (sender, args) => { Network.Connect(); _connectBox.Show(); }; }
public MirButton() { HoverIndex = -1; PressedIndex = -1; Sound = SoundList.ButtonB; _label = new MirLabel { NotControl = true, Parent = this, //Font = new Font("Constantia", 8, FontStyle.Italic), //OutLine = true, //OutLineColour = Color.FromArgb(255, 70, 50, 30), }; }
public ChatNoticeDialog() { Index = 1361; Library = Libraries.Prguse; Movable = false; Sort = false; Location = new Point(Settings.ScreenWidth / 2 - Size.Width / 2, Settings.ScreenHeight / 6 - Size.Height / 2); Opacity = 0.7F; TextLabel1 = new MirLabel { Text = "", Font = new Font(Settings.FontName, 10F), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, NotControl = true, Location = new Point(0, -6), Size = new Size(660, 40), ForeColour = Color.Yellow, OutLineColour = Color.Black, }; TextLabel2 = new MirLabel { Text = "", Font = new Font(Settings.FontName, 15F), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, NotControl = true, Location = new Point(0, 0), Size = new Size(660, 40), ForeColour = Color.Yellow, OutLineColour = Color.Black, }; Layout = new MirImageControl { Index = 1360, Library = Libraries.Prguse, Location = new Point(0, 0), Parent = this }; AfterDraw += ChatNotice_AfterDraw; }
public MirCheckBox() { TickedIndex = -1; UnTickedIndex = -1; Index = -1; HoverIndex = -1; PressedIndex = -1; Sound = SoundList.ButtonB; Click += MirCheckBox_Click; _label = new MirLabel { AutoSize = true, NotControl = true, Location = new Point(15, -2), Parent = this }; }
public MirGoodsCell() { Size = new Size(205, 32); BorderColour = Color.Lime; NameLabel = new MirLabel { AutoSize = true, Parent = this, NotControl = true, Location = new Point(44, 0), }; CountLabel = new MirLabel { AutoSize = true, Parent = this, NotControl = true, DrawControlTexture = true, Location = new Point(23, 17), ForeColour = Color.Yellow, }; PriceLabel = new MirLabel { AutoSize = true, Parent = this, NotControl = true, Location = new Point(44, 14), }; NewIcon = new MirImageControl { Index = 550, Library = Libraries.Prguse, Parent = this, Location = new Point(190, 5), NotControl = true, Visible = false }; BeforeDraw += (o, e) => Update(); AfterDraw += (o, e) => DrawItem(); }
private void NewColour(string text, string colour, Point p) { Color textColour = Color.FromName(colour); MirLabel temp = new MirLabel { AutoSize = true, Visible = true, Parent = this, Location = p, Text = text, ForeColour = textColour, Font = Font }; //temp.MouseWheel += NPCDialog_MouseWheel; _textButtons.Add(temp); }
protected override void Dispose(bool Disposing) { if (Disposing) { HoverIndexChanged = null; _HoverIndex = 0; if (Label != null && !Label.IsDisposed) { Label.Dispose(); } Label = null; PressedIndexChanged = null; _PressedIndex = 0; } base.Dispose(Disposing); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (!disposing) { return; } HoverIndexChanged = null; _hoverIndex = 0; if (_label != null && !_label.IsDisposed) { _label.Dispose(); } _label = null; PressedIndexChanged = null; _pressedIndex = 0; }
private void CreateDisposeLabel() { if (Item.Info.StackSize < 1) { DisposeCountLabel(); return; } if (CountLabel == null || CountLabel.IsDisposed) { CountLabel = new MirLabel { AutoSize = true, ForeColor = Color.Yellow, NotControl = true, OutLine = false, Parent = this, }; } CountLabel.Text = Item.Amount.ToString("###0"); CountLabel.Location = new Point(Size.Width - CountLabel.Size.Width, Size.Height - CountLabel.Size.Height); }
private void CreateDisposeLabel() { if (Count <= 1) { DisposeCountLabel(); return; } if (CountLabel == null || CountLabel.IsDisposed) { CountLabel = new MirLabel { AutoSize = true, ForeColour = Color.Yellow, NotControl = true, OutLine = false, Parent = this, }; } CountLabel.Text = Count.ToString("###0"); CountLabel.Location = new Point(Size.Width - CountLabel.Size.Width + 8, Size.Height - CountLabel.Size.Height); }
public GuestTradeDialog() { Index = 390; Library = Libraries.Prguse; Movable = true; Size = new Size(204, 152); Location = new Point((Settings.ScreenWidth / 2) + 10, Settings.ScreenHeight - 350); Sort = true; #region Host labels GuestNameLabel = new MirLabel { Parent = this, Location = new Point(0, 10), Size = new Size(204, 14), DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, NotControl = true, }; GuestGoldLabel = new MirLabel { DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Font = new Font(Settings.FontName, 8F), Location = new Point(35, 123), Parent = this, Size = new Size(90, 15), Sound = SoundList.Gold, NotControl = true, }; #endregion #region Grids GuestGrid = new MirItemCell[5 * 2]; for (int x = 0; x < 5; x++) { for (int y = 0; y < 2; y++) { GuestGrid[2 * x + y] = new MirItemCell { ItemSlot = 2 * x + y, GridType = MirGridType.GuestTrade, Parent = this, Location = new Point(x * 36 + 10 + x, y * 32 + 39 + y), }; } } #endregion }
public TradeDialog() { Index = 389; Library = Libraries.Prguse; Movable = true; Size = new Size(204, 152); Location = new Point((Settings.ScreenWidth / 2) - Size.Width - 10, Settings.ScreenHeight - 350); Sort = true; #region Buttons ConfirmButton = new MirButton { Index = 520, HoverIndex = 521, Location = new Point(135, 120), Size = new Size(48, 25), Library = Libraries.Title, Parent = this, PressedIndex = 522, Sound = SoundList.ButtonA, }; ConfirmButton.Click += (o, e) => { ChangeLockState(!GameScene.User.TradeLocked); }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(Size.Width - 23, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => { Hide(); GameScene.Scene.GuestTradeDialog.Hide(); TradeCancel(); }; #endregion #region Host labels NameLabel = new MirLabel { Parent = this, Location = new Point(20, 10), Size = new Size(150, 14), DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, NotControl = true, }; GoldLabel = new MirLabel { DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Font = new Font(Settings.FontName, 8F), Location = new Point(35, 123), Parent = this, Size = new Size(90, 15), Sound = SoundList.Gold, }; GoldLabel.Click += (o, e) => { if (GameScene.SelectedCell == null && GameScene.Gold > 0) { MirAmountBox amountBox = new MirAmountBox("Trade Amount:", 116, GameScene.Gold); amountBox.OKButton.Click += (c, a) => { if (amountBox.Amount > 0) { GameScene.User.TradeGoldAmount += amountBox.Amount; Network.Enqueue(new C.TradeGold { Amount = amountBox.Amount }); RefreshInterface(); } }; amountBox.Show(); GameScene.PickedUpGold = false; } }; #endregion #region Grids Grid = new MirItemCell[5 * 2]; for (int x = 0; x < 5; x++) { for (int y = 0; y < 2; y++) { Grid[2 * x + y] = new MirItemCell { ItemSlot = 2 * x + y, GridType = MirGridType.Trade, Parent = this, Location = new Point(x * 36 + 10 + x, y * 32 + 39 + y), }; } } #endregion }
public QuestSingleQuestItem(ClientQuestProgress quest) { Quest = quest; Size = new Size(250, 15); TrackQuest = GameScene.Scene.QuestTrackingDialog.TrackedQuestsIds.Contains(quest.Id); string name = Quest.QuestInfo.Name; string level = string.Format("Lv{0}", Quest.QuestInfo.MinLevelNeeded); string state = quest.Completed ? "(Complete)" : "(In Progress)"; bool lowLevelQuest = (MapObject.User.Level - quest.QuestInfo.MinLevelNeeded) > 10; BeforeDraw += QuestTaskSingleItem_BeforeDraw; AfterDraw += QuestTaskSingleItem_AfterDraw; _selectedImage = new MirImageControl { Index = 956, Library = Libraries.Prguse, Location = new Point(-10, 0), Parent = this, Visible = false }; _questLabel = new MirLabel { Text = string.Format("{0,-4} {1}", level, name), AutoSize = true, Font = new Font(Settings.FontName, 8F), ForeColour = lowLevelQuest ? Color.Gray : quest.New ? Color.Yellow : Color.White, Parent = this, Location = new Point(0, 0), Sound = SoundList.ButtonA }; _questLabel.Click += (o, e) => { MouseEventArgs me = e as MouseEventArgs; if (me == null) return; switch (me.Button) { case MouseButtons.Left: GameScene.Scene.QuestDetailDialog.DisplayQuestDetails(Quest); break; case MouseButtons.Right: { if (TrackQuest) { GameScene.Scene.QuestTrackingDialog.RemoveQuest(Quest); } else { if (GameScene.Scene.QuestTrackingDialog.TrackedQuestsIds.Count >= 5) return; GameScene.Scene.QuestTrackingDialog.AddQuest(Quest); } TrackQuest = !TrackQuest; } break; } OnSelectedQuestChanged(); }; _stateLabel = new MirLabel { Text = string.Format("{0}", state), AutoSize = true, Font = new Font(Settings.FontName, 8F), ForeColour = lowLevelQuest ? Color.Gray : quest.New ? Color.Yellow : Color.White, Parent = this, Location = new Point(185, 0), Sound = SoundList.ButtonA }; }
public QuestRow() { Sound = SoundList.ButtonA; Size = new Size(200, 17); BeforeDraw += QuestRow_BeforeDraw; SelectedImage = new MirImageControl { Index = 956, Library = Libraries.Prguse, Location = new Point(25, 0), Parent = this, Visible = false }; IconImage = new MirImageControl { Index = 0, Library = Libraries.Prguse, Location = new Point(3, 0), Parent = this, Visible = false }; RequirementLabel = new MirLabel { Location = new Point(20, 0), Size = new Size(178, 17), DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, }; NameLabel = new MirLabel { Location = new Point(60, 0), Size = new Size(140, 17), DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, }; UpdateInterface(); }
private void NewText(List<string> lines, bool resetIndex = true) { if (resetIndex) { TopLine = 0; CurrentLines = lines; UpdatePositionBar(); } foreach (MirLabel t in _textButtons.Where(t => t != null)) t.Dispose(); foreach (MirLabel t in _textLabel.Where(t => t != null)) t.Text = ""; _textButtons.Clear(); int adjust = 0; BottomLine = lines.Count > LineCount ? ((LineCount + TopLine) > lines.Count ? lines.Count : (LineCount + TopLine)) : lines.Count; for (int i = TopLine; i < BottomLine; i++) { Font font = Font; Color fontColor = Color.White; bool title = false; if (i == 0 || lines[i] == TaskTitle || lines[i] == ProgressTitle) { font = new Font(Settings.FontName, 10F, FontStyle.Bold); title = true; if (i == 0) { fontColor = Color.Yellow; } } _textLabel[i - TopLine] = new MirLabel { Font = font, ForeColour = fontColor, DrawFormat = TextFormatFlags.WordBreak, Visible = true, Parent = this, Size = new Size(Size.Width, 20), Location = new Point(title ? 15 : 0, 0 + (i - TopLine) * 15 + adjust), NotControl = true }; if (title) { adjust += 5; } if (i >= lines.Count) { _textLabel[i - TopLine].Text = string.Empty; continue; } string currentLine = lines[i]; List<Match> matchList = C.Matches(currentLine).Cast<Match>().ToList(); int oldLength = currentLine.Length; foreach (Match match in matchList.OrderBy(o => o.Index).ToList()) { int offSet = oldLength - currentLine.Length; Capture capture = match.Groups[1].Captures[0]; string[] values = capture.Value.Split('/'); currentLine = currentLine.Remove(capture.Index - 1 - offSet, capture.Length + 2).Insert(capture.Index - 1 - offSet, values[0]); string text = currentLine.Substring(0, capture.Index - 1 - offSet) + " "; Size size = TextRenderer.MeasureText(CMain.Graphics, text, _textLabel[i - TopLine].Font, _textLabel[i - TopLine].Size, TextFormatFlags.TextBoxControl); if (C.Match(match.Value).Success) NewColour(values[0], values[1], _textLabel[i - TopLine].Location.Add(new Point(size.Width - 10, 0))); } _textLabel[i - TopLine].Text = currentLine; _textLabel[i - TopLine].MouseWheel += QuestMessage_MouseWheel; } }
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) }; }
protected override void Dispose(bool disposing) { if (disposing) { Background = null; _character = null; ServerLabel = null; CharacterDisplay = null; StartGameButton = null; NewCharacterButton = null; DeleteCharacterButton = null; CreditsButton = null; ExitGame = null; CharacterButtons = null; LastAccessLabel = null;LastAccessLabelLabel = null; Characters = null; _selected = 0; } base.Dispose(disposing); }
public MirAmountBox(string title, int image, uint max, uint min = 0) { ImageIndex = image; MaxAmount = max; MinAmount = min; Amount = max; Modal = true; Movable = false; Index = 660; Library = Libraries.Prguse; Location = new Point((800 - Size.Width) / 2, (600 - Size.Height) / 2); TitleLabel = new MirLabel { AutoSize = true, Location = new Point(19 + 2, 8 + 15 + 3), Parent = this, NotControl = true, Text = title }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(180, 23), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, Visible = false, }; CloseButton.Click += (o, e) => Dispose(); ItemImage = new MirControl { Location = new Point(15, 34), Size = new Size(38, 34), Parent = this, Visible = false, }; ItemImage.AfterDraw += (o, e) => DrawItem(); OKButton = new MirButton { HoverIndex = 383, Index = 382, Library = Libraries.Title, Location = new Point(23 + 120, 76 + 47), Parent = this, PressedIndex = 384, }; OKButton.Click += (o, e) => Dispose(); CancelButton = new MirButton { HoverIndex = 386, Index = 385, Library = Libraries.Title, Location = new Point(110 + 100, 76 + 47), Parent = this, PressedIndex = 387, }; CancelButton.Click += (o, e) => Dispose(); InputTextBox = new MirTextBox { Parent = this, Border = true, BorderColour = Color.Lime, Location = new Point(59 - 37 + 2, 43 + 40 + 4), Size = new Size(238, 19), }; InputTextBox.SetFocus(); //InputTextBox.Font = new Font(Settings.FontName, 10); InputTextBox.TextBox.KeyPress += MirInputBox_KeyPress; InputTextBox.TextBox.TextChanged += TextBox_TextChanged; InputTextBox.Text = MaxAmount.ToString(); InputTextBox.TextBox.SelectionStart = 0; InputTextBox.TextBox.SelectionLength = InputTextBox.Text.Length; }
public MirDropDownBox() { BackColour = Color.FromArgb(0x0F, 0x0F, 0x42); ForeColour = Color.White; Enabled = false; _label = new MirLabel { Parent = this, Location = new Point(0, 0), ForeColour = ForeColour, BackColour = BackColour, Font = new Font(Settings.FontName, 7F), Visible = true, }; _label.Click += (o, e) => { if (_DropDownButton.Enabled) { DropDownClick(); } }; _label.BeforeDraw += (o, e) => { if ((Items.Count > 0) && (Items.Count >= SelectedIndex)) { if (SelectedIndex == -1) { _label.Text = " "; } else { _label.Text = Items[SelectedIndex]; } } else { _label.Text = "None"; } }; for (int i = 0; i < _Option.Length; i++) { _Option[i] = new MirLabel { Parent = this, Visible = false, Location = new Point(0, 15 + (i * 13)), ForeColour = ForeColour, BackColour = Color.MidnightBlue, Font = new Font(Settings.FontName, 7F) }; int index = i; _Option[index].MouseEnter += (o, e) => _Option[index].BackColour = Color.Blue; _Option[index].MouseLeave += (o, e) => _Option[index].BackColour = Color.MidnightBlue; _Option[index].MouseDown += (o, e) => _Option[index].BackColour = Color.MidnightBlue; _Option[index].MouseUp += (o, e) => _Option[index].BackColour = Color.MidnightBlue; _Option[index].Click += (o, e) => SelectOption(index); _Option[index].BeforeDraw += (o, e) => { if (Items.Count > (ScrollIndex + index + MinimumOption)) { _Option[index].Text = _Items[ScrollIndex + index + MinimumOption]; } }; } _DropDownButton = new MirButton { Index = 314, Library = Libraries.Prguse, Location = new Point(Size.Width - 16, 0), Parent = this, PressedIndex = 315, Visible = false, }; _DropDownButton.Click += (o, e) => DropDownClick(); _ScrollUp = new MirButton { HoverIndex = 2022, Index = 2021, Library = Libraries.Prguse, Location = new Point(Size.Width - 12, 14), Parent = this, PressedIndex = 2023, Visible = false }; _ScrollUp.Click += (o, e) => ScrollUp(); _ScrollDown = new MirButton { HoverIndex = 2025, Index = 2024, Library = Libraries.Prguse, Location = new Point(Size.Width - 12, 52), Parent = this, PressedIndex = 2026, Visible = false }; _ScrollDown.Click += (o, e) => ScrollDown(); _ScrollBar = new MirImageControl { Index = 2012, Library = Libraries.Prguse, Location = new Point(Size.Width - 8, 22), Parent = this, Visible = false }; _ScrollPosition = new MirButton { HoverIndex = 2016, Index = 2015, Library = Libraries.Prguse, Location = new Point(Size.Width - 11, 22), Movable = true, Parent = this, PressedIndex = 2017, Visible = false }; _ScrollPosition.OnMoving += ScrollPosition; BeforeDraw += MirDropDownBox_BeforeDraw; }
private void NewColour(string text, string colour, Point p) { Color textColour = Color.FromName(colour); MirLabel temp = new MirLabel { AutoSize = true, Visible = true, Parent = this, Location = p, Text = text, ForeColour = textColour, Font = Font }; temp.MouseWheel += QuestMessage_MouseWheel; _textButtons.Add(temp); }
private void DisposeCountLabel() { if (CountLabel != null && !CountLabel.IsDisposed) CountLabel.Dispose(); CountLabel = null; }
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; }
public QuestRewards() { _expLabel = new MirLabel { Size = new Size(75, 20), Location = new Point(40, 0), Parent = this }; _goldLabel = new MirLabel { Size = new Size(75, 20), Parent = this }; _creditLabel = new MirLabel { Size = new Size(75, 20), Location = new Point(60, 0), Parent = this }; BeforeDraw += QuestReward_BeforeDraw; }
public void DisplayQuests() { foreach (MirLabel label in TaskLines) label.Dispose(); List<ClientQuestProgress> questsToTrack = new List<ClientQuestProgress>(); questsToTrack.Clear(); questsToTrack.AddRange(from quest in MapObject.User.CurrentQuests from id in TrackedQuestsIds.Where(id => quest.Id == id) select quest); if (questsToTrack.Count < 1) { Hide(); return; } int y = 0; for (int i = 0; i < questsToTrack.Count; i++) { _questNameLabel = new MirLabel { Text = questsToTrack[i].QuestInfo.Name, AutoSize = true, BackColour = Color.Transparent, Font = QuestFont, ForeColour = Color.LimeGreen, Location = new Point(5, 20 + y), OutLine = true, Parent = this, Visible = true, }; TaskLines.Add(_questNameLabel); foreach (string questToTrack in questsToTrack[i].TaskList) { y += 15; string trackedQuest = questToTrack; _questTaskLabel = new MirLabel { Text = trackedQuest, AutoSize = true, BackColour = Color.Transparent, Font = QuestFont, ForeColour = Color.White, //trackedQuest.Contains("(Completed)") ? Color.LimeGreen : Location = new Point(25, 20 + y), OutLine = true, Parent = this, Visible = true, }; TaskLines.Add(_questTaskLabel); } if (i >= 5) break; y += 30; } Show(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); Quest = null; NameLabel = null; RequirementLabel = null; SelectedImage = null; IconImage = null; Selected = false; }
public QuestGroupQuestItem(string group, List<ClientQuestProgress> quests, bool expanded) { Group = group; Quests = quests; Expanded = expanded; _expandButton = new MirButton { Index = Expanded ? 917 : 918, Library = Libraries.Prguse, Parent = this, Size = new Size(16, 14), Location = new Point(0, 0), Sound = SoundList.ButtonA }; _expandButton.Click += (o, e) => ChangeExpand(); _groupLabel = new MirLabel { Text = Group, AutoSize = true, Parent = this, Font = new Font(Settings.FontName, 8F), ForeColour = Color.LimeGreen, Location = new Point(18, 0), Visible = true, }; for (int i = 0; i < Quests.Count; i++) { QuestSingleQuestItem singleQuest = new QuestSingleQuestItem(Quests[i]) { Parent = this, Location = new Point(18, (15 * (i + 1))), Size = new Size(280, 15), Visible = Expanded }; singleQuest.SelectedQuestChanged += (o, e) => OnSelectedQuestChanged(o); _tasks.Add(singleQuest); if (Expanded) SizeY += 15; } Size = new Size(280, SizeY); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); Quest = null; _questLabel.Dispose(); _questLabel = null; }
public void NewText(List <string> lines, bool resetIndex = true) { if (resetIndex) { Index = 0; CurrentLines = lines; } foreach (MirLabel t in _textButtons) { t.Dispose(); } foreach (MirLabel t in _textLabel.Where(t => t != null)) { t.Text = ""; } _textButtons.Clear(); int lastLine = lines.Count > VisibleLines ? ((VisibleLines + Index) > lines.Count ? lines.Count : (VisibleLines + Index)) : lines.Count; for (int i = Index; i < lastLine; i++) { _textLabel[i - Index] = new MirLabel { Font = Font, DrawFormat = TextFormatFlags.WordBreak, Visible = true, Parent = this, Size = new Size(Size.Width, 20), Location = new Point(0, 0 + (i - Index) * 15), NotControl = true }; if (i >= lines.Count) { _textLabel[i - Index].Text = string.Empty; continue; } string currentLine = lines[i]; List <Match> matchList = R.Matches(currentLine).Cast <Match>().ToList(); matchList.AddRange(C.Matches(currentLine).Cast <Match>()); int oldLength = currentLine.Length; foreach (Match match in matchList.OrderBy(o => o.Index).ToList()) { int offSet = oldLength - currentLine.Length; Capture capture = match.Groups[1].Captures[0]; string[] values = capture.Value.Split('/'); currentLine = currentLine.Remove(capture.Index - 1 - offSet, capture.Length + 2).Insert(capture.Index - 1 - offSet, values[0]); string text = currentLine.Substring(0, capture.Index - 1 - offSet) + " "; Size size = TextRenderer.MeasureText(CMain.Graphics, text, _textLabel[i - Index].Font, _textLabel[i - Index].Size, TextFormatFlags.TextBoxControl); //if (R.Match(match.Value).Success) // NewButton(values[0], values[1], TextLabel[i].Location.Add(new Point(size.Width - 10, 0))); if (C.Match(match.Value).Success) { NewColour(values[0], values[1], _textLabel[i - Index].Location.Add(new Point(size.Width - 10, 0))); } } _textLabel[i - Index].Text = currentLine; //TextLabel[i].MouseWheel += NPCDialog_MouseWheel; } }
public QuestDiaryDialog() { Index = 961; Library = Libraries.Prguse; Movable = true; Sort = true; Location = new Point(Settings.ScreenWidth / 2 - 300 - 20, 60); MirImageControl TitleLabel = new MirImageControl { Index = 15, Library = Libraries.Title, Location = new Point(18, 5), Parent = this }; _takenQuestsLabel = new MirLabel { Font = new Font(Settings.FontName, 8F), Parent = this, AutoSize = true, Location = new Point(210, 7) }; _closeButton = new MirButton { Index = 193, HoverIndex = 194, PressedIndex = 195, Library = Libraries.Title, Parent = this, Location = new Point(200, 437), Sound = SoundList.ButtonA, }; _closeButton.Click += (o, e) => Hide(); MirButton closeButton = new MirButton { Index = 360, HoverIndex = 361, PressedIndex = 362, Library = Libraries.Prguse2, Parent = this, Location = new Point(289, 3), Sound = SoundList.ButtonA, }; closeButton.Click += (o, e) => Hide(); }
public MainDialog() { Index = Settings.Resolution == 800 ? 0 : Settings.Resolution == 1024 ? 1 : 2; Library = Libraries.Prguse; Location = new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)), Settings.ScreenHeight - Size.Height); PixelDetect = true; LeftCap = new MirImageControl { Index = 12, Library = Libraries.Prguse, Location = new Point(-67, this.Size.Height - 96), Parent = this, Visible = false }; RightCap = new MirImageControl { Index = 13, Library = Libraries.Prguse, Location = new Point(1024, this.Size.Height - 104), Parent = this, Visible = false }; if (Settings.Resolution > 1024) { LeftCap.Visible = true; RightCap.Visible = true; } InventoryButton = new MirButton { HoverIndex = 1904, Index = 1903, Library = Libraries.Prguse, Location = new Point(this.Size.Width - 96, 76), Parent = this, PressedIndex = 1905, Sound = SoundList.ButtonA, Hint = "Inventory (I)" }; InventoryButton.Click += (o, e) => { if (GameScene.Scene.InventoryDialog.Visible) GameScene.Scene.InventoryDialog.Hide(); else GameScene.Scene.InventoryDialog.Show(); }; CharacterButton = new MirButton { HoverIndex = 1901, Index = 1900, Library = Libraries.Prguse, Location = new Point(this.Size.Width - 119, 76), Parent = this, PressedIndex = 1902, Sound = SoundList.ButtonA, Hint = "Character (C)" }; CharacterButton.Click += (o, e) => { if (GameScene.Scene.CharacterDialog.Visible && GameScene.Scene.CharacterDialog.CharacterPage.Visible) GameScene.Scene.CharacterDialog.Hide(); else { GameScene.Scene.CharacterDialog.Show(); GameScene.Scene.CharacterDialog.ShowCharacterPage(); } }; SkillButton = new MirButton { HoverIndex = 1907, Index = 1906, Library = Libraries.Prguse, Location = new Point(this.Size.Width - 73, 76), Parent = this, PressedIndex = 1908, Sound = SoundList.ButtonA, Hint = "Skills (S)" }; SkillButton.Click += (o, e) => { if (GameScene.Scene.CharacterDialog.Visible && GameScene.Scene.CharacterDialog.SkillPage.Visible) GameScene.Scene.CharacterDialog.Hide(); else { GameScene.Scene.CharacterDialog.Show(); GameScene.Scene.CharacterDialog.ShowSkillPage(); } }; QuestButton = new MirButton { HoverIndex = 1910, Index = 1909, Library = Libraries.Prguse, Location = new Point(this.Size.Width - 50, 76), Parent = this, PressedIndex = 1911, Sound = SoundList.ButtonA, Hint = "Quests (Q)" }; QuestButton.Click += (o, e) => { if (!GameScene.Scene.QuestLogDialog.Visible) GameScene.Scene.QuestLogDialog.Show(); else GameScene.Scene.QuestLogDialog.Hide(); }; OptionButton = new MirButton { HoverIndex = 1913, Index = 1912, Library = Libraries.Prguse, Location = new Point(this.Size.Width - 27, 76), Parent = this, PressedIndex = 1914, Sound = SoundList.ButtonA, Hint = "Options (O)" }; OptionButton.Click += (o, e) => { if (!GameScene.Scene.OptionDialog.Visible) GameScene.Scene.OptionDialog.Show(); else GameScene.Scene.OptionDialog.Hide(); }; MenuButton = new MirButton { HoverIndex = 1961, Index = 1960, Library = Libraries.Prguse, Location = new Point(this.Size.Width - 55, 35), Parent = this, PressedIndex = 1962, Sound = SoundList.ButtonC, Hint = "Menu" }; MenuButton.Click += (o, e) => { if (!GameScene.Scene.MenuDialog.Visible) GameScene.Scene.MenuDialog.Show(); else GameScene.Scene.MenuDialog.Hide(); }; GameShopButton = new MirButton { HoverIndex = 827, Index = 826, Library = Libraries.Prguse, Location = new Point(this.Size.Width - 105, 35), Parent = this, PressedIndex = 828, Sound = SoundList.ButtonC, Hint = "Game Shop" }; GameShopButton.Click += (o, e) => { if (!GameScene.Scene.GameShopDialog.Visible) GameScene.Scene.GameShopDialog.Show(); else GameScene.Scene.GameShopDialog.Hide(); }; HealthOrb = new MirControl { Parent = this, Location = new Point(0, 30), NotControl = true, }; HealthOrb.BeforeDraw += HealthOrb_BeforeDraw; HealthLabel = new MirLabel { AutoSize = true, Location = new Point(0, 27), Parent = HealthOrb }; HealthLabel.SizeChanged += Label_SizeChanged; ManaLabel = new MirLabel { AutoSize = true, Location = new Point(0, 42), Parent = HealthOrb }; ManaLabel.SizeChanged += Label_SizeChanged; TopLabel = new MirLabel { Size = new Size(85, 30), DrawFormat = TextFormatFlags.HorizontalCenter, Location = new Point(9, 20), Parent = HealthOrb, }; BottomLabel = new MirLabel { Size = new Size(85, 30), DrawFormat = TextFormatFlags.HorizontalCenter, Location = new Point(9, 50), Parent = HealthOrb, }; LevelLabel = new MirLabel { AutoSize = true, Parent = this, Location = new Point(5, 108) }; CharacterName = new MirLabel { DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(6, 120), Size = new Size(90, 16) }; ExperienceBar = new MirImageControl { Index = Settings.Resolution != 800 ? 8 : 7, Library = Libraries.Prguse, Location = new Point(9, 143), Parent = this, DrawImage = false, NotControl = true, }; ExperienceBar.BeforeDraw += ExperienceBar_BeforeDraw; ExperienceLabel = new MirLabel { AutoSize = true, Parent = ExperienceBar, NotControl = true, }; GoldLabel = new MirLabel { DrawFormat = TextFormatFlags.VerticalCenter, Font = new Font(Settings.FontName, 8F), Location = new Point(this.Size.Width - 105, 119), Parent = this, Size = new Size(99, 13), Sound = SoundList.Gold, }; GoldLabel.Click += (o, e) => { if (GameScene.SelectedCell == null) GameScene.PickedUpGold = !GameScene.PickedUpGold && GameScene.Gold > 0; }; WeightBar = new MirImageControl { Index = 76, Library = Libraries.Prguse, Location = new Point(this.Size.Width - 105, 103), Parent = this, DrawImage = false, NotControl = true, }; WeightBar.BeforeDraw += WeightBar_BeforeDraw; WeightLabel = new MirLabel { Parent = this, Location = new Point(this.Size.Width - 30, 101), Size = new Size(26, 14), }; AModeLabel = new MirLabel { AutoSize = true, ForeColour = Color.Yellow, OutLineColour = Color.Black, Parent = this, Location = new Point(Settings.Resolution != 800 ? 899 : 675, Settings.Resolution != 800 ? -448 : -280), }; PModeLabel = new MirLabel { AutoSize = true, ForeColour = Color.Orange, OutLineColour = Color.Black, Parent = this, Location = new Point(230, 125), Visible = false }; SModeLabel = new MirLabel { AutoSize = true, ForeColour = Color.LimeGreen, OutLineColour = Color.Black, Parent = this, Location = new Point(Settings.Resolution != 800 ? 899 : 675, Settings.Resolution != 800 ? -463 : -295), }; }
public QuestListDialog() { Index = 950; Library = Libraries.Prguse; Movable = true; Sort = true; Location = new Point(GameScene.Scene.NPCDialog.Size.Width + 47, 0); MirImageControl TitleLabel = new MirImageControl { Index = 14, Library = Libraries.Title, Location = new Point(18, 5), Parent = this }; #region QuestSelection MirButton upQuestButton = new MirButton { Index = 951, HoverIndex = 952, PressedIndex = 953, Library = Libraries.Prguse, Parent = this, Location = new Point(291, 35), Sound = SoundList.ButtonA, }; upQuestButton.Click += (o, e) => { if (SelectedQuest != null) { SelectedIndex = FindSelectedIndex(); if (SelectedIndex > 0) SelectedIndex--; else StartIndex--; } RefreshInterface(); }; MirButton downQuestButton = new MirButton { Index = 957, HoverIndex = 958, PressedIndex = 959, Library = Libraries.Prguse, Parent = this, Location = new Point(291, 83), Sound = SoundList.ButtonA, }; downQuestButton.Click += (o, e) => { if (SelectedQuest != null) { SelectedIndex = FindSelectedIndex(); if (SelectedIndex < Rows.Length - 1) SelectedIndex++; else StartIndex++; } RefreshInterface(); }; #endregion #region Buttons _acceptButton = new MirButton { Index = 270, HoverIndex = 271, PressedIndex = 272, Library = Libraries.Title, Parent = this, Location = new Point(40, 437), Sound = SoundList.ButtonA, }; _acceptButton.Click += (o, e) => { if (Reward == null || SelectedQuest.Taken) return; Network.Enqueue(new C.AcceptQuest { NPCIndex = SelectedQuest.QuestInfo.NPCIndex, QuestIndex = SelectedQuest.QuestInfo.Index }); //Hide(); }; _finishButton = new MirButton { Index = 273, HoverIndex = 274, PressedIndex = 275, Library = Libraries.Title, Parent = this, Location = new Point(40, 437), Sound = SoundList.ButtonA, Visible = false }; _finishButton.Click += (o, e) => { if (Reward == null || !SelectedQuest.Completed) return; if (Reward.SelectedItemIndex < 0 && SelectedQuest.QuestInfo.RewardsSelectItem.Count > 0) { MirMessageBox messageBox = new MirMessageBox("You must select a reward item."); messageBox.Show(); return; } Network.Enqueue(new C.FinishQuest { QuestIndex = SelectedQuest.QuestInfo.Index, SelectedItemIndex = Reward.SelectedItemIndex }); //Hide(); }; MirButton leaveButton = new MirButton { Index = 276, HoverIndex = 277, PressedIndex = 278, Library = Libraries.Title, Parent = this, Location = new Point(205, 437), Sound = SoundList.ButtonA, }; leaveButton.Click += (o, e) => Hide(); #endregion #region Message Area MirButton upButton = new MirButton { Index = 197, HoverIndex = 198, PressedIndex = 199, Library = Libraries.Prguse2, Parent = this, Size = new Size(16, 14), Location = new Point(292, 136), Sound = SoundList.ButtonA, Visible = true }; MirButton downButton = new MirButton { Index = 207, HoverIndex = 208, Library = Libraries.Prguse2, PressedIndex = 209, Parent = this, Size = new Size(16, 14), Location = new Point(292, 282), Sound = SoundList.ButtonA, Visible = true }; MirButton positionBar = new MirButton { Index = 205, HoverIndex = 206, PressedIndex = 206, Library = Libraries.Prguse2, Location = new Point(292, 149), Parent = this, Movable = true, Sound = SoundList.None, Visible = false }; Message = new QuestMessage(upButton, downButton, positionBar, 10) { Font = new Font(Settings.FontName, 9F), Parent = this, Size = new Size(280, 160), Location = new Point(10, 135), PosMinY = 149, PosMaxY = 263 }; #endregion #region Rewards Reward = new QuestRewards { Parent = this, Visible = false, Size = new Size(313, 130), Location = new Point(5, 307) }; #endregion _availableQuestLabel = new MirLabel { Font = new Font(Settings.FontName, 8F), Parent = this, AutoSize = true, Location = new Point(210, 8) }; MirButton closeButton = new MirButton { Index = 360, HoverIndex = 361, PressedIndex = 362, Library = Libraries.Prguse2, Parent = this, Location = new Point(289, 3), Sound = SoundList.ButtonA, }; closeButton.Click += (o, e) => Hide(); MirButton helpButton = new MirButton { Index = 257, HoverIndex = 258, PressedIndex = 259, Library = Libraries.Prguse2, Parent = this, Location = new Point(266, 3), Sound = SoundList.ButtonA, }; helpButton.Click += (o, e) => GameScene.Scene.HelpDialog.DisplayPage("Quests"); }
public override void CreateLabel() { NameLabel = null; GuildLabel = null; for (int i = 0; i < LabelList.Count; i++) { if (LabelList[i].Text != Name || LabelList[i].ForeColour != NameColour) continue; NameLabel = LabelList[i]; break; } for (int i = 0; i < LabelList.Count; i++) { if (LabelList[i].Text != GuildName || LabelList[i].ForeColour != NameColour) continue; GuildLabel = LabelList[i]; break; } if (NameLabel != null && !NameLabel.IsDisposed && GuildLabel != null && !GuildLabel.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); GuildLabel = new MirLabel { AutoSize = true, BackColour = Color.Transparent, ForeColour = NameColour, OutLine = true, OutLineColour = Color.Black, Text = GuildName, }; GuildLabel.Disposing += (o, e) => LabelList.Remove(GuildLabel); LabelList.Add(GuildLabel); }
public SelectScene(List<SelectInfo> characters) { SoundManager.PlaySound(SoundList.SelectMusic, true); Disposing += (o, e) => SoundManager.StopSound(SoundList.SelectMusic); Characters = characters; SortList(); KeyPress +=SelectScene_KeyPress; Background = new MirImageControl { Index = 64, Library = Libraries.Prguse, Parent = this, }; Title = new MirImageControl { Index = 40, Library = Libraries.Title, Parent = this, Location = new Point(364, 12) }; ServerLabel = new MirLabel { Location = new Point(322, 44), Parent = Background, Size = new Size(155, 17), Text = "Legend of Mir 2", DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter }; StartGameButton = new MirButton { Enabled = false, HoverIndex = 341, Index = 340, Library = Libraries.Title, Location = new Point(110, 568), Parent = Background, PressedIndex = 342 }; StartGameButton.Click += (o, e) => StartGame(); NewCharacterButton = new MirButton { HoverIndex = 344, Index = 343, Library = Libraries.Title, Location = new Point(230, 568), Parent = Background, PressedIndex = 345, GrayScale = true }; NewCharacterButton.Click += (o, e) => _character = new NewCharacterDialog { Parent = this }; DeleteCharacterButton = new MirButton { HoverIndex = 347, Index = 346, Library = Libraries.Title, Location = new Point(350, 568), Parent = Background, PressedIndex = 348 }; DeleteCharacterButton.Click += (o, e) => DeleteCharacter(); CreditsButton = new MirButton { HoverIndex = 350, Index = 349, Library = Libraries.Title, Location = new Point(470, 568), Parent = Background, PressedIndex = 351 }; ExitGame = new MirButton { HoverIndex = 353, Index = 352, Library = Libraries.Title, Location = new Point(590, 568), Parent = Background, PressedIndex = 354 }; ExitGame.Click += (o, e) => Program.Form.Close(); CharacterDisplay = new MirAnimatedControl { Animated = true, AnimationCount = 16, AnimationDelay = 250, FadeIn = true, FadeInDelay = 75, FadeInRate = 0.1F, Index = 220, Library = Libraries.ChrSel, Location = new Point(200, 300), Parent = Background, UseOffSet = true, Visible = false }; CharacterDisplay.AfterDraw += (o, e) => { // if (_selected >= 0 && _selected < Characters.Count && characters[_selected].Class == MirClass.Wizard) Libraries.ChrSel.DrawBlend(CharacterDisplay.Index + 560, CharacterDisplay.DisplayLocationWithoutOffSet, Color.White, true); }; CharacterButtons = new CharacterButton[4]; CharacterButtons[0] = new CharacterButton { Location = new Point(447, 122), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[0].Click += (o,e) => { if (characters.Count <= 0) return; _selected = 0; UpdateInterface(); }; CharacterButtons[1] = new CharacterButton { Location = new Point(447, 226), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[1].Click += (o, e) => { if (characters.Count <= 1) return; _selected = 1; UpdateInterface(); }; CharacterButtons[2] = new CharacterButton { Location = new Point(447, 330), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[2].Click += (o, e) => { if (characters.Count <= 2) return; _selected = 2; UpdateInterface(); }; CharacterButtons[3] = new CharacterButton { Location = new Point(447, 434), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[3].Click += (o, e) => { if (characters.Count <= 3) return; _selected = 3; UpdateInterface(); }; LastAccessLabel = new MirLabel { Location = new Point(140, 509), Parent = Background, Size = new Size(180, 21), DrawFormat = TextFormatFlags.Left | TextFormatFlags.VerticalCenter, Border = true, }; LastAccessLabelLabel = new MirLabel { Location = new Point(-80, -1), Parent = LastAccessLabel, Text = "Last Online:", Size = new Size(100, 21), DrawFormat = TextFormatFlags.Left | TextFormatFlags.VerticalCenter, Border = true, }; UpdateInterface(); }
public MirAmountBox(string title, int image, uint max, uint min = 0, uint defaultAmount = 0) { ImageIndex = image; MaxAmount = max; MinAmount = min; Amount = max; Modal = true; Movable = false; Index = 238; Library = Libraries.CustomPrguse; Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2); TitleLabel = new MirLabel { AutoSize = true, Location = new Point(19, 8), Parent = this, NotControl = true, Text = title }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(180, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Dispose(); ItemImage = new MirControl { Location = new Point(15, 34), Size = new Size(38, 34), Parent = this, }; ItemImage.AfterDraw += (o, e) => DrawItem(); OKButton = new MirButton { HoverIndex = 201, Index = 200, Library = Libraries.CustomTitle, Location = new Point(23, 76), Parent = this, PressedIndex = 202, }; OKButton.Click += (o, e) => Dispose(); CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.CustomTitle, Location = new Point(110, 76), Parent = this, PressedIndex = 205, }; CancelButton.Click += (o, e) => Dispose(); InputTextBox = new MirTextBox { Parent = this, Border = true, BorderColour = Color.Lime, Location = new Point(58, 43), Size = new Size(132, 19), }; InputTextBox.SetFocus(); InputTextBox.TextBox.KeyPress += MirInputBox_KeyPress; InputTextBox.TextBox.TextChanged += TextBox_TextChanged; InputTextBox.Text = (defaultAmount > 0 && defaultAmount <= MaxAmount) ? defaultAmount.ToString() : MaxAmount.ToString(); InputTextBox.TextBox.SelectionStart = 0; InputTextBox.TextBox.SelectionLength = InputTextBox.Text.Length; }
public NewCharacterDialog() { Index = 73; Library = Libraries.Prguse; Location = new Point((Settings.ScreenWidth - Size.Width)/2, (Settings.ScreenHeight - Size.Height)/2); Modal = true; TitleLabel = new MirImageControl { Index = 20, Library = Libraries.Title, Location = new Point(206, 11), Parent = this, }; CancelButton = new MirButton { HoverIndex = 281, Index = 280, Library = Libraries.Title, Location = new Point(425, 425), Parent = this, PressedIndex = 282 }; CancelButton.Click += (o, e) => Dispose(); OKButton = new MirButton { Enabled = false, HoverIndex = 361, Index = 360, Library = Libraries.Title, Location = new Point(160, 425), Parent = this, PressedIndex = 362, }; OKButton.Click += (o, e) => CreateCharacter(); NameTextBox = new MirTextBox { Location = new Point(325, 268), Parent = this, Size = new Size(240, 20), MaxLength = Globals.MaxCharacterNameLength }; NameTextBox.TextBox.KeyPress += TextBox_KeyPress; NameTextBox.TextBox.TextChanged += CharacterNameTextBox_TextChanged; NameTextBox.SetFocus(); CharacterDisplay = new MirAnimatedControl { Animated = true, AnimationCount = 16, AnimationDelay = 250, Index = 20, Library = Libraries.ChrSel, Location = new Point(120, 250), Parent = this, UseOffSet = true, }; CharacterDisplay.AfterDraw += (o, e) => { if (_class == MirClass.Wizard) Libraries.ChrSel.DrawBlend(CharacterDisplay.Index + 560, CharacterDisplay.DisplayLocationWithoutOffSet, Color.White, true); }; WarriorButton = new MirButton { HoverIndex = 2427, Index = 2427, Library = Libraries.Prguse, Location = new Point(323, 296), Parent = this, PressedIndex = 2428, Sound = SoundList.ButtonA, }; WarriorButton.Click += (o, e) => { _class = MirClass.Warrior; UpdateInterface(); }; WizardButton = new MirButton { HoverIndex = 2430, Index = 2429, Library = Libraries.Prguse, Location = new Point(373, 296), Parent = this, PressedIndex = 2431, Sound = SoundList.ButtonA, }; WizardButton.Click += (o, e) => { _class = MirClass.Wizard; UpdateInterface(); }; TaoistButton = new MirButton { HoverIndex = 2433, Index = 2432, Library = Libraries.Prguse, Location = new Point(423, 296), Parent = this, PressedIndex = 2434, Sound = SoundList.ButtonA, }; TaoistButton.Click += (o, e) => { _class = MirClass.Taoist; UpdateInterface(); }; AssassinButton = new MirButton { HoverIndex = 2436, Index = 2435, Library = Libraries.Prguse, Location = new Point(473, 296), Parent = this, PressedIndex = 2437, Sound = SoundList.ButtonA, }; AssassinButton.Click += (o, e) => { _class = MirClass.Assassin; UpdateInterface(); }; ArcherButton = new MirButton { HoverIndex = 2439, Index = 2438, Library = Libraries.Prguse, Location = new Point(523, 296), Parent = this, PressedIndex = 2440, Sound = SoundList.ButtonA, }; ArcherButton.Click += (o, e) => { _class = MirClass.Archer; UpdateInterface(); }; MaleButton = new MirButton { HoverIndex = 2421, Index = 2421, Library = Libraries.Prguse, Location = new Point(323, 343), Parent = this, PressedIndex = 2422, Sound = SoundList.ButtonA, }; MaleButton.Click += (o, e) => { _gender = MirGender.Male; UpdateInterface(); }; FemaleButton = new MirButton { HoverIndex = 2424, Index = 2423, Library = Libraries.Prguse, Location = new Point(373, 343), Parent = this, PressedIndex = 2425, Sound = SoundList.ButtonA, }; FemaleButton.Click += (o, e) => { _gender = MirGender.Female; UpdateInterface(); }; Description = new MirLabel { Border = true, Location = new Point(279, 70), Parent = this, Size = new Size(278, 170), Text = WarriorDescription, }; }
public MirAmountBox(string title, int image, string message) { ImageIndex = image; Modal = true; Movable = false; Index = 238; Library = Libraries.CustomPrguse; Location = new Point((800 - Size.Width) / 2, (600 - Size.Height) / 2); TitleLabel = new MirLabel { AutoSize = true, Location = new Point(19, 8), Parent = this, NotControl = true, Text = title }; TextLabel = new MirLabel { AutoSize = true, Location = new Point(60, 43), ForeColour = Color.Yellow, Parent = this, NotControl = true, Text = message }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(180, 3), Library = Libraries.CustomPrguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Dispose(); ItemImage = new MirControl { Location = new Point(15, 34), Size = new Size(38, 34), Parent = this, }; ItemImage.AfterDraw += (o, e) => DrawItem(); OKButton = new MirButton { HoverIndex = 201, Index = 200, Library = Libraries.CustomTitle, Location = new Point(23, 76), Parent = this, PressedIndex = 202, }; OKButton.Click += (o, e) => Dispose(); CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.CustomTitle, Location = new Point(110, 76), Parent = this, PressedIndex = 205, }; CancelButton.Click += (o, e) => Dispose(); }
public MirMessageBox(string message, MirMessageBoxButtons b = MirMessageBoxButtons.OK, bool allowKeys = true) { DrawImage = true; ForeColour = Color.White; Buttons = b; Modal = true; Movable = false; AllowKeyPress = allowKeys; Index = 360; Library = Libraries.Prguse; Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2); Label = new MirLabel { AutoSize = false, // DrawFormat = StringFormatFlags.FitBlackBox, Location = new Point(35, 35), Size = new Size(390, 110), Parent = this, Text = message }; switch (Buttons) { case MirMessageBoxButtons.OK: OKButton = new MirButton { HoverIndex = 201, Index = 200, Library = Libraries.Title, Location = new Point(360, 157), Parent = this, PressedIndex = 202, }; OKButton.Click += (o, e) => Dispose(); break; case MirMessageBoxButtons.OKCancel: OKButton = new MirButton { HoverIndex = 201, Index = 200, Library = Libraries.Title, Location = new Point(260, 157), Parent = this, PressedIndex = 202, }; OKButton.Click += (o, e) => Dispose(); CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.Title, Location = new Point(360, 157), Parent = this, PressedIndex = 205, }; CancelButton.Click += (o, e) => Dispose(); break; case MirMessageBoxButtons.YesNo: YesButton = new MirButton { HoverIndex = 207, Index = 206, Library = Libraries.Title, Location = new Point(260, 157), Parent = this, PressedIndex = 208, }; YesButton.Click += (o, e) => Dispose(); NoButton = new MirButton { HoverIndex = 211, Index = 210, Library = Libraries.Title, Location = new Point(360, 157), Parent = this, PressedIndex = 212, }; NoButton.Click += (o, e) => Dispose(); break; case MirMessageBoxButtons.YesNoCancel: YesButton = new MirButton { HoverIndex = 207, Index = 206, Library = Libraries.Title, Location = new Point(160, 157), Parent = this, PressedIndex = 208, }; YesButton.Click += (o, e) => Dispose(); NoButton = new MirButton { HoverIndex = 211, Index = 210, Library = Libraries.Title, Location = new Point(260, 157), Parent = this, PressedIndex = 212, }; NoButton.Click += (o, e) => Dispose(); CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.Title, Location = new Point(360, 157), Parent = this, PressedIndex = 205, }; CancelButton.Click += (o, e) => Dispose(); break; case MirMessageBoxButtons.Cancel: CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.Title, Location = new Point(360, 157), Parent = this, PressedIndex = 205, }; CancelButton.Click += (o, e) => Dispose(); break; } }
public GameShopCell() { Size = new Size(125, 146); Index = 750; Library = Libraries.CustomTitle; MouseLeave += (o, e) => { GameScene.Scene.DisposeItemLabel(); GameScene.HoverItem = null; ShowItem = null; }; nameLabel = new MirLabel { Size = new Size(125, 15), DrawFormat = TextFormatFlags.HorizontalCenter, Location = new Point(0, 13), Parent = this, NotControl = true, Font = new Font(Settings.FontName, 8F), }; goldLabel = new MirLabel { Size = new Size(95, 20), DrawFormat = TextFormatFlags.RightToLeft | TextFormatFlags.Right, Location = new Point(2, 102), Parent = this, NotControl = true, Font = new Font(Settings.FontName, 8F) }; gpLabel = new MirLabel { Size = new Size(95, 20), DrawFormat = TextFormatFlags.RightToLeft | TextFormatFlags.Right, Location = new Point(2, 81), Parent = this, NotControl = true, Font = new Font(Settings.FontName, 8F) }; StockLabel = new MirLabel { Size = new Size(40, 20), Location = new Point(53, 37), Parent = this, NotControl = true, ForeColour = Color.Gray, Font = new Font(Settings.FontName, 7F), Text = "STOCK:" }; stockLabel = new MirLabel { Size = new Size(20, 20), DrawFormat = TextFormatFlags.HorizontalCenter, Location = new Point(93, 37), Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), }; countLabel = new MirLabel { Size = new Size(30, 20), DrawFormat = TextFormatFlags.Right, Location = new Point(16, 60), Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), }; BuyItem = new MirButton { Index = 778, HoverIndex = 779, PressedIndex = 780, Location = new Point(42, 122), Library = Libraries.CustomTitle, Parent = this, Sound = SoundList.ButtonA, }; BuyItem.Click += (o, e) => { BuyProduct(); }; PreviewItem = new MirButton { Index = 781, HoverIndex = 782, PressedIndex = 783, Location = new Point(8, 122), Library = Libraries.CustomTitle, Parent = this, Sound = SoundList.ButtonA, Visible = false, }; PreviewItem.Click += (o, e) => { GameScene.Scene.GameShopDialog.Viewer.Dispose(); GameScene.Scene.GameShopDialog.Viewer = new GameShopViewer { Parent = GameScene.Scene.GameShopDialog, Visible = true, Location = this.Location.X < 350 ? new Point(416, 115) : new Point(151, 115), }; GameScene.Scene.GameShopDialog.Viewer.ViewerItem = Item; GameScene.Scene.GameShopDialog.Viewer.UpdateViewer(); }; quantityUp = new MirButton { Index = 243, HoverIndex = 244, PressedIndex = 245, Library = Libraries.CustomPrguse2, Parent = this, Location = new Point(97, 56), Sound = SoundList.ButtonA, }; quantityUp.Click += (o, e) => { if (CMain.Shift) { Quantity += 10; } else { Quantity++; } if (((decimal)(Quantity * Item.Count) / Item.Info.StackSize) > 5) { Quantity = ((5 * Item.Info.StackSize) / Item.Count) > 99 ? Quantity = 99 : Quantity = (byte)((5 * Item.Info.StackSize) / Item.Count); } if (Quantity >= 99) { Quantity = 99; } if (Item.Stock != 0 && Quantity > Item.Stock) { Quantity = (byte)Item.Stock; } }; quantityDown = new MirButton { Index = 240, HoverIndex = 241, PressedIndex = 242, Library = Libraries.CustomPrguse2, Parent = this, Location = new Point(55, 56), Sound = SoundList.ButtonA, }; quantityDown.Click += (o, e) => { if (CMain.Shift) { Quantity -= 10; } else { Quantity--; } if (Quantity <= 1 || Quantity > 99) { Quantity = 1; } }; quantity = new MirLabel { Size = new Size(20, 13), DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Location = new Point(74, 56), Parent = this, NotControl = true, Font = new Font(Settings.FontName, 8F), }; }
private static void CreateHintLabel() { if (HintBaseLabel == null || HintBaseLabel.IsDisposed) { HintBaseLabel = new MirControl { BackColour = Color.FromArgb(128, 128, 50), Border = true, DrawControlTexture = true, BorderColour = Color.Yellow, ForeColour = Color.Yellow, Parent = MirScene.ActiveScene, NotControl = true, Opacity = 0.5F }; } if (HintTextLabel == null || HintTextLabel.IsDisposed) { HintTextLabel = new MirLabel { AutoSize = true, BackColour = Color.Transparent, ForeColour = Color.White, Parent = HintBaseLabel, }; HintTextLabel.SizeChanged += (o, e) => HintBaseLabel.Size = HintTextLabel.Size; } if (MirControl.MouseControl == null || string.IsNullOrEmpty(MirControl.MouseControl.Hint)) { HintBaseLabel.Visible = false; return; } HintBaseLabel.Visible = true; HintTextLabel.Text = MirControl.MouseControl.Hint; Point point = MPoint.Add(-HintTextLabel.Size.Width, 20); if (point.X + HintBaseLabel.Size.Width >= Settings.ScreenWidth) point.X = Settings.ScreenWidth - HintBaseLabel.Size.Width - 1; if (point.Y + HintBaseLabel.Size.Height >= Settings.ScreenHeight) point.Y = Settings.ScreenHeight - HintBaseLabel.Size.Height - 1; if (point.X < 0) point.X = 0; if (point.Y < 0) point.Y = 0; HintBaseLabel.Location = point; }
public MirMessageBox1(string message, MirMessageBoxButtons1 b = MirMessageBoxButtons1.OK) { DrawImage = true; ForeColour = Color.White; Buttons = b; Modal = true; Movable = false; Index = 990; Library = Libraries.Prguse; Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2); Label = new MirLabel { AutoSize = false, // DrawFormat = StringFormatFlags.FitBlackBox, Location = new Point(35 - 20, 35 - 16), Size = new Size(390, 110), Parent = this, Text = message }; switch (Buttons) { case MirMessageBoxButtons1.OK: OKButton = new MirButton { HoverIndex = 201, Index = 200, Library = Libraries.Title, Location = new Point(340, 157), Parent = this, PressedIndex = 202, }; OKButton.Click += (o, e) => Dispose(); break; case MirMessageBoxButtons1.OKCancel: OKButton = new MirButton { HoverIndex = 201, Index = 200, Library = Libraries.Title, Location = new Point(250, 157), Parent = this, PressedIndex = 202, }; OKButton.Click += (o, e) => Dispose(); CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.Title, Location = new Point(340, 157), Parent = this, PressedIndex = 205, }; CancelButton.Click += (o, e) => Dispose(); break; case MirMessageBoxButtons1.YesNo: // 116 YesButton = new MirButton { HoverIndex = 117, Index = 116, Library = Libraries.Title, Location = new Point(250 - 30 - 50 - 15, 157 - 50 - 15 + 4), Parent = this, PressedIndex = 118, }; YesButton.Click += (o, e) => Dispose(); NoButton = new MirButton { HoverIndex = 184, Index = 183, Library = Libraries.Title, Location = new Point(340 - 30 - 50 - 25 - 10, 157 - 50 - 15 + 4), Parent = this, PressedIndex = 185, }; NoButton.Click += (o, e) => Dispose(); break; case MirMessageBoxButtons1.YesNoCancel: YesButton = new MirButton { HoverIndex = 207, Index = 206, Library = Libraries.Title, Location = new Point(160, 157), Parent = this, PressedIndex = 208, }; YesButton.Click += (o, e) => Dispose(); NoButton = new MirButton { HoverIndex = 211, Index = 210, Library = Libraries.Title, Location = new Point(250, 157), Parent = this, PressedIndex = 212, }; NoButton.Click += (o, e) => Dispose(); CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.Title, Location = new Point(340, 157), Parent = this, PressedIndex = 205, }; CancelButton.Click += (o, e) => Dispose(); break; case MirMessageBoxButtons1.Cancel: CancelButton = new MirButton { HoverIndex = 204, Index = 203, Library = Libraries.Title, Location = new Point(340, 157), Parent = this, PressedIndex = 205, }; CancelButton.Click += (o, e) => Dispose(); break; } }