private void DeleteCharacter() { if (_selected < 0 || _selected >= Characters.Count) { return; } MirMessageBox message = new MirMessageBox(string.Format("Are you sure you want to Delete the character {0}?", Characters[_selected].Name), MirMessageBoxButtons.YesNo); int index = Characters[_selected].Index; message.YesButton.Click += (o1, e1) => { MirInputBox inputBox = new MirInputBox("Please enter the characters name."); inputBox.OKButton.Click += (o, e) => { string name = Characters[_selected].Name.ToString(); if (inputBox.InputTextBox.Text == name) { DeleteCharacterButton.Enabled = false; Network.Enqueue(new C.DeleteCharacter { CharacterIndex = index }); } else { MirMessageBox failedMessage = new MirMessageBox(string.Format("Incorrect Entry."), MirMessageBoxButtons.OK); failedMessage.Show(); } inputBox.Dispose(); }; inputBox.Show(); }; message.Show(); }
public void InputRentalPeroid() { var inputBox = new MirInputBox($"你想把{RentalItem.Name}租给{GameScene.Scene.GuestItemRentDialog.GuestName}多久? (1-30天)。"); inputBox.OKButton.Click += (o1, e1) => { if (!uint.TryParse(inputBox.InputTextBox.Text, out RentalPeriod)) { return; } if (RentalPeriod < 1 || RentalPeriod > 30) { return; } RefreshInterface(); inputBox.Dispose(); Network.Enqueue(new C.ItemRentalPeriod { Days = RentalPeriod }); }; inputBox.Show(); }
public void InputRentalPeroid() { var inputBox = new MirInputBox($"How long would you like to rent {RentalItem.Name} to {GameScene.Scene.GuestItemRentDialog.GuestName} for? (1 to 30 days)."); inputBox.OKButton.Click += (o1, e1) => { if (!uint.TryParse(inputBox.InputTextBox.Text, out RentalPeriod)) { return; } if (RentalPeriod < 1 || RentalPeriod > 30) { return; } RefreshInterface(); inputBox.Dispose(); Network.Enqueue(new C.ItemRentalPeriod { Days = RentalPeriod }); }; inputBox.Show(); }
private void DeleteCharacter() { if (_selected < 0 || _selected >= Characters.Count) { return; } MirMessageBox message = new MirMessageBox(string.Format("是否确实要删除该角色{0}?", Characters[_selected].Name), MirMessageBoxButtons.YesNo); int index = Characters[_selected].Index; message.YesButton.Click += (o1, e1) => { MirInputBox inputBox = new MirInputBox("请输入角色名称进行确认."); inputBox.OKButton.Click += (o, e) => { string name = Characters[_selected].Name.ToString(); if (inputBox.InputTextBox.Text == name) { DeleteCharacterButton.Enabled = false; Network.Enqueue(new C.DeleteCharacter { CharacterIndex = index }); } else { MirMessageBox failedMessage = new MirMessageBox(string.Format("输入名称错误."), MirMessageBoxButtons.OK); failedMessage.Show(); } inputBox.Dispose(); }; inputBox.Show(); }; message.Show(); }
private void MailSendRequest(S.MailSendRequest p) { MirInputBox inputBox = new MirInputBox("Please enter the name of the person you would like to mail."); inputBox.OKButton.Click += (o1, e1) => { GameScene.Scene.MailComposeParcelDialog.ComposeMail(inputBox.InputTextBox.Text); GameScene.Scene.InventoryDialog.Show(); //open letter dialog, pass in name inputBox.Dispose(); }; inputBox.Show(); }
private void DelMember() { if (GroupList.Count > 0 && GroupList[0] != MapObject.User.Name) { GameScene.Scene.ChatDialog.ReceiveChat("You are not the leader of your group.", ChatType.System); return; } MirInputBox inputBox = new MirInputBox(GameLanguage.GroupRemoveEnterName); inputBox.OKButton.Click += (o, e) => { Network.Enqueue(new C.DelMember { Name = inputBox.InputTextBox.Text }); inputBox.Dispose(); }; inputBox.Show(); }
private void DelMember() { if (GroupList.Count > 0 && GroupList[0] != MapObject.User.Name) { GameScene.Scene.ChatDialog.ReceiveChat("你不是队长。", ChatType.System); return; } MirInputBox inputBox = new MirInputBox("请输入你要组队的人的名字。"); inputBox.OKButton.Click += (o, e) => { Network.Enqueue(new C.DelMember { Name = inputBox.InputTextBox.Text }); inputBox.Dispose(); }; inputBox.Show(); }
private void DelMember() { if (GroupList.Count > 0 && GroupList[0] != MapObject.User.Name) { GameScene.Scene.ChatDialog.ReceiveChatTr("You are not the leader of your group.", ChatType.System); return; } MirInputBox inputBox = new MirInputBox(CMain.Tr("Please enter the name of the person you wish to group.")); inputBox.OKButton.Click += (o, e) => { Network.Enqueue(new C.DelMember { Name = inputBox.InputTextBox.Text }); inputBox.Dispose(); }; inputBox.Show(); }
private void AddMember() { if (GroupList.Count >= Globals.MaxGroup) { GameScene.Scene.ChatDialog.ReceiveChat("Your group already has the maximum number of members.", ChatType.System); return; } if (GroupList.Count > 0 && GroupList[0] != MapObject.User.Name) { GameScene.Scene.ChatDialog.ReceiveChat("You are not the leader of your group.", ChatType.System); return; } MirInputBox inputBox = new MirInputBox(GameLanguage.GroupAddEnterName); inputBox.OKButton.Click += (o, e) => { Network.Enqueue(new C.AddMember { Name = inputBox.InputTextBox.Text }); inputBox.Dispose(); }; inputBox.Show(); }
private void AddMember() { if (GroupList.Count >= Globals.MaxGroup) { GameScene.Scene.ChatDialog.ReceiveChat("你的小队人员已达上限.", ChatType.System); return; } if (GroupList.Count > 0 && GroupList[0] != MapObject.User.Name) { GameScene.Scene.ChatDialog.ReceiveChat("你不是队长.", ChatType.System); return; } MirInputBox inputBox = new MirInputBox(GameLanguage.GroupAddEnterName); inputBox.OKButton.Click += (o, e) => { Network.Enqueue(new C.AddMember { Name = inputBox.InputTextBox.Text }); inputBox.Dispose(); }; inputBox.Show(); }
public MailListDialog() { Index = 670; Library = Libraries.Title; Size = new Size(312, 444); Movable = true; Sort = true; Location = new Point((Settings.ScreenWidth - Size.Width) - 150, 5); TitleLabel = new MirImageControl { Index = 7, Library = Libraries.Title, Location = new Point(18, 9), Parent = this }; TitleTypeLabel = new MirLabel { Text = "TYPE", Parent = this, Font = new Font(Settings.FontName, Settings.FontSize - 1, FontStyle.Italic), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Size = new Size(37, 19), Location = new Point(8, 34) }; TitleSenderLabel = new MirLabel { Text = "SENDER", Parent = this, Font = new Font(Settings.FontName, Settings.FontSize - 1, FontStyle.Italic), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Size = new Size(132, 19), Location = new Point(47, 34) }; TitleMessageLabel = new MirLabel { Text = "MESSAGE", Parent = this, Font = new Font(Settings.FontName, Settings.FontSize - 1, FontStyle.Italic), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Size = new Size(122, 19), Location = new Point(181, 34) }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(Size.Width - 24, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); HelpButton = new MirButton { Index = 257, HoverIndex = 258, PressedIndex = 259, Library = Libraries.Prguse2, Parent = this, Location = new Point(Size.Width - 50, 3), Sound = SoundList.ButtonA, }; HelpButton.Click += (o, e) => GameScene.Scene.HelpDialog.DisplayPage(""); PreviousButton = new MirButton { Index = 240, HoverIndex = 241, PressedIndex = 242, Library = Libraries.Prguse2, Parent = this, Location = new Point(102, Size.Height - 55), Sound = SoundList.ButtonA, }; PreviousButton.Click += (o, e) => { if (CurrentPage <= 1) { return; } SelectedMail = null; CurrentPage--; StartIndex -= 10; UpdateInterface(); }; PageLabel = new MirLabel { Text = "", Parent = this, Location = new Point(120, Size.Height - 55), Size = new Size(67, 15), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, }; NextButton = new MirButton { Index = 243, HoverIndex = 244, PressedIndex = 245, Library = Libraries.Prguse2, Parent = this, Location = new Point(192, Size.Height - 55), Sound = SoundList.ButtonA, }; NextButton.Click += (o, e) => { if (CurrentPage >= PageCount) { return; } SelectedMail = null; CurrentPage++; StartIndex += 10; UpdateInterface(); }; #region Action Buttons SendButton = new MirButton { Index = 563, HoverIndex = 564, PressedIndex = 565, Library = Libraries.Prguse, Parent = this, Location = new Point(75, 414), Sound = SoundList.ButtonA, Hint = GameLanguage.Send }; SendButton.Click += (o, e) => { MirInputBox inputBox = new MirInputBox(GameLanguage.EnterMailToName); inputBox.OKButton.Click += (o1, e1) => { //open letter dialog, pass in name GameScene.Scene.MailComposeLetterDialog.ComposeMail(inputBox.InputTextBox.Text); inputBox.Dispose(); }; inputBox.Show(); }; ReplyButton = new MirButton { Index = 569, HoverIndex = 570, PressedIndex = 571, Library = Libraries.Prguse, Parent = this, Location = new Point(102, 414), Sound = SoundList.ButtonA, Hint = GameLanguage.Reply }; ReplyButton.Click += (o, e) => { if (SelectedMail == null) { return; } GameScene.Scene.MailComposeLetterDialog.ComposeMail(SelectedMail.SenderName); }; ReadButton = new MirButton { Index = 572, HoverIndex = 573, PressedIndex = 574, Library = Libraries.Prguse, Parent = this, Location = new Point(129, 414), Sound = SoundList.ButtonA, Hint = GameLanguage.Read }; ReadButton.Click += (o, e) => { if (SelectedMail == null) { return; } if (SelectedMail.Gold > 0 || SelectedMail.Items.Count > 0) { GameScene.Scene.MailReadParcelDialog.ReadMail(SelectedMail); } else { GameScene.Scene.MailReadLetterDialog.ReadMail(SelectedMail); } }; DeleteButton = new MirButton { Index = 557, HoverIndex = 558, PressedIndex = 559, Library = Libraries.Prguse, Parent = this, Location = new Point(156, 414), Sound = SoundList.ButtonA, Hint = GameLanguage.Delete }; DeleteButton.Click += (o, e) => { if (SelectedMail == null || SelectedMail.Locked) { return; } if (SelectedMail.Items.Count > 0 || SelectedMail.Gold > 0) { MirMessageBox messageBox = new MirMessageBox("This parcel contains items or gold. Are you sure you want to delete it?", MirMessageBoxButtons.YesNo); messageBox.YesButton.Click += (o1, e1) => { Network.Enqueue(new C.DeleteMail { MailID = SelectedMail.MailID }); SelectedMail = null; }; messageBox.Show(); } else { Network.Enqueue(new C.DeleteMail { MailID = SelectedMail.MailID }); SelectedMail = null; } }; BlockListButton = new MirButton { Index = 520, HoverIndex = 521, PressedIndex = 522, Library = Libraries.Prguse, Parent = this, Location = new Point(183, 414), Sound = SoundList.ButtonA, Hint = GameLanguage.BlockList, GrayScale = true, Enabled = false }; BugReportButton = new MirButton { Index = 523, HoverIndex = 524, PressedIndex = 525, Library = Libraries.Prguse, Parent = this, Location = new Point(210, 414), Sound = SoundList.ButtonA, Hint = "Report Bug", GrayScale = true, Enabled = false }; #endregion }
public FriendDialog() { Index = 199; Library = Libraries.Title; Movable = true; Sort = true; Location = Center; TitleLabel = new MirImageControl { Index = 6, Library = Libraries.Title, Location = new Point(18, 8), Parent = this }; FriendLabel = new MirImageControl { Index = 163, Library = Libraries.Title, Location = new Point(10, 34), Parent = this, Sound = SoundList.ButtonA, }; FriendLabel.Click += (o, e) => { _tempBlockedTab = false; UpdateDisplay(); }; BlacklistLabel = new MirImageControl { Index = 167, Library = Libraries.Title, Location = new Point(128, 34), Parent = this, Sound = SoundList.ButtonA, }; BlacklistLabel.Click += (o, e) => { _tempBlockedTab = true; UpdateDisplay(); }; PageNumberLabel = new MirLabel { Text = "", Parent = this, Size = new Size(83, 17), Location = new Point(87, 216), DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter }; #region Buttons PreviousButton = new MirButton { Index = 240, HoverIndex = 241, PressedIndex = 242, Library = Libraries.Prguse2, Parent = this, Size = new Size(16, 16), Location = new Point(70, 218), Sound = SoundList.ButtonA, }; PreviousButton.Click += (o, e) => { Page--; if (Page < 0) { Page = 0; } StartIndex = Rows.Length * Page; Update(); }; NextButton = new MirButton { Index = 243, HoverIndex = 244, PressedIndex = 245, Library = Libraries.Prguse2, Parent = this, Size = new Size(16, 16), Location = new Point(171, 218), Sound = SoundList.ButtonA, }; NextButton.Click += (o, e) => { Page++; if (Page > Friends.Count() / Rows.Length) { Page = Friends.Count() / Rows.Length; } StartIndex = Rows.Length * Page; Update(); }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(237, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); AddButton = new MirButton { Index = 554, HoverIndex = 555, PressedIndex = 556, Library = Libraries.Prguse, Location = new Point(60, 241), Parent = this, Sound = SoundList.ButtonA }; AddButton.Click += (o, e) => { ; string message = string.Format("Please enter the name of the person you would like to {0}.", _blockedTab ? "block" : "add"); MirInputBox inputBox = new MirInputBox(message); inputBox.OKButton.Click += (o1, e1) => { Network.Enqueue(new C.AddFriend { Name = inputBox.InputTextBox.Text, Blocked = _blockedTab }); inputBox.Dispose(); }; inputBox.Show(); }; RemoveButton = new MirButton { Index = 557, HoverIndex = 558, PressedIndex = 559, Library = Libraries.Prguse, Location = new Point(88, 241), Parent = this, Sound = SoundList.ButtonA }; RemoveButton.Click += (o, e) => { if (SelectedFriend == null) { return; } MirMessageBox messageBox = new MirMessageBox(string.Format("Are you sure you wish to remove '{0}'?", SelectedFriend.Name), MirMessageBoxButtons.YesNo); messageBox.YesButton.Click += (o1, e1) => { Network.Enqueue(new C.RemoveFriend { CharacterIndex = SelectedFriend.Index }); messageBox.Dispose(); }; messageBox.Show(); }; MemoButton = new MirButton { Index = 560, HoverIndex = 561, PressedIndex = 562, Library = Libraries.Prguse, Location = new Point(116, 241), Parent = this, Sound = SoundList.ButtonA }; MemoButton.Click += (o, e) => { if (SelectedFriend == null) { return; } GameScene.Scene.MemoDialog.Friend = SelectedFriend; GameScene.Scene.MemoDialog.Show(); }; EmailButton = new MirButton { Index = 563, HoverIndex = 564, PressedIndex = 565, Library = Libraries.Prguse, Location = new Point(144, 241), Parent = this, Sound = SoundList.ButtonA }; EmailButton.Click += (o, e) => { if (SelectedFriend == null) { return; } GameScene.Scene.MailComposeLetterDialog.ComposeMail(SelectedFriend.Name); }; WhisperButton = new MirButton { Index = 566, HoverIndex = 567, PressedIndex = 568, Library = Libraries.Prguse, Location = new Point(172, 241), Parent = this, Sound = SoundList.ButtonA }; WhisperButton.Click += (o, e) => { if (SelectedFriend == null) { return; } if (!SelectedFriend.Online) { GameScene.Scene.ChatDialog.ReceiveChat("Player is not online", ChatType.System); return; } GameScene.Scene.ChatDialog.ChatTextBox.SetFocus(); GameScene.Scene.ChatDialog.ChatTextBox.Text = "/" + SelectedFriend.Name + " "; GameScene.Scene.ChatDialog.ChatTextBox.Visible = true; GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionLength = 0; GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionStart = GameScene.Scene.ChatDialog.ChatTextBox.Text.Length; }; #endregion }
public MentorDialog() { Index = 170; Library = Libraries.Prguse; Movable = true; Sort = true; Location = Center; TitleLabel = new MirImageControl { Index = 51, Library = Libraries.Title, Location = new Point(18, 8), Parent = this }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(219, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); AllowButton = new MirButton { HoverIndex = 115, Index = 114, Location = new Point(30, 178), Library = Libraries.Prguse, Parent = this, PressedIndex = 116, Sound = SoundList.ButtonA, Hint = "Allow/Disallow Mentor Requests", }; AllowButton.Click += (o, e) => { if (AllowButton.Index == 116) { AllowButton.Index = 117; AllowButton.HoverIndex = 118; AllowButton.PressedIndex = 119; } else { AllowButton.Index = 114; AllowButton.HoverIndex = 115; AllowButton.PressedIndex = 116; } Network.Enqueue(new C.AllowMentor()); }; AddButton = new MirButton { HoverIndex = 214, Index = 213, Location = new Point(60, 178), Library = Libraries.Title, Parent = this, PressedIndex = 215, Sound = SoundList.ButtonA, Hint = "Add Mentor", }; AddButton.Click += (o, e) => { if (MentorLevel != 0) { GameScene.Scene.ChatDialog.ReceiveChatTr("You already have a Mentor.", ChatType.System); return; } string message = CMain.Tr("Please enter the name of the person you would like to be your Mentor."); MirInputBox inputBox = new MirInputBox(message); inputBox.OKButton.Click += (o1, e1) => { Network.Enqueue(new C.AddMentor { Name = inputBox.InputTextBox.Text }); inputBox.Dispose(); }; inputBox.Show(); }; RemoveButton = new MirButton { HoverIndex = 217, Index = 216, Location = new Point(135, 178), Library = Libraries.Title, Parent = this, PressedIndex = 218, Sound = SoundList.ButtonA, Hint = "Remove Mentor/Mentee", }; RemoveButton.Click += (o, e) => { if (MentorName == "") { GameScene.Scene.ChatDialog.ReceiveChatTr("You don't currently have a Mentorship to cancel.", ChatType.System); return; } MirMessageBox messageBox = new MirMessageBox(string.Format("Cancelling a Mentorship early will cause a cooldown. Are you sure?"), MirMessageBoxButtons.YesNo); messageBox.YesButton.Click += (oo, ee) => Network.Enqueue(new C.CancelMentor { }); messageBox.NoButton.Click += (oo, ee) => { messageBox.Dispose(); }; messageBox.Show(); }; MentorNameLabel = new MirLabel { Location = new Point(20, 58), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.LightGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 10F), }; MentorLevelLabel = new MirLabel { Location = new Point(170, 58), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.LightGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 10F), }; MentorOnlineLabel = new MirLabel { Location = new Point(125, 58), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.Green, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), Visible = false, Text = "ONLINE", }; StudentNameLabel = new MirLabel { Location = new Point(20, 112), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.LightGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 10F), }; StudentLevelLabel = new MirLabel { Location = new Point(170, 111), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.LightGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 10F), }; StudentOnlineLabel = new MirLabel { Location = new Point(125, 112), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.Green, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), Visible = false, Text = "ONLINE", }; MentorLabel = new MirLabel { Location = new Point(15, 41), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.DimGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), Text = "MENTOR", }; StudentLabel = new MirLabel { Location = new Point(15, 94), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.DimGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), Text = "MENTEE", }; MenteeEXPLabel = new MirLabel { Location = new Point(15, 147), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.DimGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), }; }
public MentorDialog() { Index = 170; Library = Libraries.Prguse; Movable = true; Sort = true; Location = Center; TitleLabel = new MirImageControl { Index = 51, Library = Libraries.Title, Location = new Point(18, 8), Parent = this }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(219, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); AllowButton = new MirButton { HoverIndex = 115, Index = 114, Location = new Point(30, 178), Library = Libraries.Prguse, Parent = this, PressedIndex = 116, Sound = SoundList.ButtonA, Hint = "允许/禁止拜师请求", }; AllowButton.Click += (o, e) => { if (AllowButton.Index == 116) { AllowButton.Index = 117; AllowButton.HoverIndex = 118; AllowButton.PressedIndex = 119; } else { AllowButton.Index = 114; AllowButton.HoverIndex = 115; AllowButton.PressedIndex = 116; } Network.Enqueue(new C.AllowMentor()); }; AddButton = new MirButton { HoverIndex = 214, Index = 213, Location = new Point(60, 178), Library = Libraries.Title, Parent = this, PressedIndex = 215, Sound = SoundList.ButtonA, Hint = "添加师父", }; AddButton.Click += (o, e) => { if (MentorLevel != 0) { GameScene.Scene.ChatDialog.ReceiveChat("你已经有师父了。", ChatType.System); return; } string message = "请输入你想要拜师的玩家名。"; MirInputBox inputBox = new MirInputBox(message); inputBox.OKButton.Click += (o1, e1) => { Network.Enqueue(new C.AddMentor { Name = inputBox.InputTextBox.Text }); inputBox.Dispose(); }; inputBox.Show(); }; RemoveButton = new MirButton { HoverIndex = 217, Index = 216, Location = new Point(135, 178), Library = Libraries.Title, Parent = this, PressedIndex = 218, Sound = SoundList.ButtonA, Hint = "取消师徒关系", }; RemoveButton.Click += (o, e) => { if (MentorName == "") { GameScene.Scene.ChatDialog.ReceiveChat("你并没有师徒关系。", ChatType.System); return; } MirMessageBox messageBox = new MirMessageBox(string.Format("取消师徒关系后一段时间内无法再次使用师徒功能,是否确定?"), MirMessageBoxButtons.YesNo); messageBox.YesButton.Click += (oo, ee) => Network.Enqueue(new C.CancelMentor { }); messageBox.NoButton.Click += (oo, ee) => { messageBox.Dispose(); }; messageBox.Show(); }; MentorNameLabel = new MirLabel { Location = new Point(20, 58), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.LightGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 10F), }; MentorLevelLabel = new MirLabel { Location = new Point(170, 58), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.LightGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 10F), }; MentorOnlineLabel = new MirLabel { Location = new Point(125, 58), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.Green, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), Visible = false, Text = "在线", }; StudentNameLabel = new MirLabel { Location = new Point(20, 112), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.LightGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 10F), }; StudentLevelLabel = new MirLabel { Location = new Point(170, 111), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.LightGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 10F), }; StudentOnlineLabel = new MirLabel { Location = new Point(125, 112), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.Green, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), Visible = false, Text = "在线", }; MentorLabel = new MirLabel { Location = new Point(15, 41), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.DimGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), Text = "师父", }; StudentLabel = new MirLabel { Location = new Point(15, 94), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.DimGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), Text = "徒弟", }; MenteeEXPLabel = new MirLabel { Location = new Point(15, 147), Size = new Size(200, 30), BackColour = Color.Empty, ForeColour = Color.DimGray, DrawFormat = TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Font = new Font(Settings.FontName, 7F), }; }
public MailListDialog() { Index = 670; Library = Libraries.CustomTitle; Size = new Size(312, 444); Movable = true; Sort = true; Location = new Point((Settings.ScreenWidth - Size.Width) - 150, 5); CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(Size.Width - 27, 3), Library = Libraries.CustomPrguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, Hint = "Exit" }; CloseButton.Click += (o, e) => Hide(); HelpButton = new MirButton { Index = 257, HoverIndex = 258, PressedIndex = 259, Library = Libraries.CustomPrguse2, Parent = this, Location = new Point(Size.Width - 50, 3), Sound = SoundList.ButtonA, }; HelpButton.Click += (o, e) => GameScene.Scene.HelpDialog.DisplayPage(""); PreviousButton = new MirButton { Index = 240, HoverIndex = 241, PressedIndex = 242, Library = Libraries.CustomPrguse2, Parent = this, Location = new Point(102, Size.Height - 55), Sound = SoundList.ButtonA, }; PreviousButton.Click += (o, e) => { if (CurrentPage <= 1) { return; } SelectedMail = null; CurrentPage--; StartIndex -= 10; UpdateInterface(); }; PageLabel = new MirLabel { Text = "", Parent = this, Location = new Point(120, Size.Height - 55), Size = new Size(67, 15), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, }; NextButton = new MirButton { Index = 243, HoverIndex = 244, PressedIndex = 245, Library = Libraries.CustomPrguse2, Parent = this, Location = new Point(192, Size.Height - 55), Sound = SoundList.ButtonA, }; NextButton.Click += (o, e) => { if (CurrentPage >= PageCount) { return; } SelectedMail = null; CurrentPage++; StartIndex += 10; UpdateInterface(); }; #region Action Buttons SendButton = new MirButton { Index = 563, HoverIndex = 564, PressedIndex = 565, Library = Libraries.CustomPrguse, Parent = this, Location = new Point(75, 414), Sound = SoundList.ButtonA, Hint = "Send" }; SendButton.Click += (o, e) => { MirInputBox inputBox = new MirInputBox("Please enter the name of the person you would like to mail."); inputBox.OKButton.Click += (o1, e1) => { //open letter dialog, pass in name GameScene.Scene.MailComposeLetterDialog.ComposeMail(inputBox.InputTextBox.Text); inputBox.Dispose(); }; inputBox.Show(); }; ReplyButton = new MirButton { Index = 569, HoverIndex = 570, PressedIndex = 571, Library = Libraries.CustomPrguse, Parent = this, Location = new Point(102, 414), Sound = SoundList.ButtonA, Hint = "Reply" }; ReplyButton.Click += (o, e) => { if (SelectedMail == null) { return; } GameScene.Scene.MailComposeLetterDialog.ComposeMail(SelectedMail.SenderName); }; ReadButton = new MirButton { Index = 572, HoverIndex = 573, PressedIndex = 574, Library = Libraries.CustomPrguse, Parent = this, Location = new Point(129, 414), Sound = SoundList.ButtonA, Hint = "Read" }; ReadButton.Click += (o, e) => { if (SelectedMail == null) { return; } if (SelectedMail.Gold > 0 || SelectedMail.Items.Count > 0) { GameScene.Scene.MailReadParcelDialog.ReadMail(SelectedMail); } else { GameScene.Scene.MailReadLetterDialog.ReadMail(SelectedMail); } }; DeleteButton = new MirButton { Index = 557, HoverIndex = 558, PressedIndex = 559, Library = Libraries.CustomPrguse, Parent = this, Location = new Point(156, 414), Sound = SoundList.ButtonA, Hint = "Delete" }; DeleteButton.Click += (o, e) => { if (SelectedMail == null || SelectedMail.Locked) { return; } if (SelectedMail.Items.Count > 0 || SelectedMail.Gold > 0) { MirMessageBox messageBox = new MirMessageBox("This parcel contains items or gold. Are you sure you want to delete it?", MirMessageBoxButtons.YesNo); messageBox.YesButton.Click += (o1, e1) => { Network.Enqueue(new C.DeleteMail { MailID = SelectedMail.MailID }); SelectedMail = null; }; messageBox.Show(); } else { Network.Enqueue(new C.DeleteMail { MailID = SelectedMail.MailID }); SelectedMail = null; } }; DeleteAllButton = new MirButton { Index = 557, HoverIndex = 558, PressedIndex = 559, Library = Libraries.CustomPrguse, Parent = this, Location = new Point(240, 414), Sound = SoundList.ButtonA, Hint = "Delete All" }; DeleteAllButton.Click += (o, e) => { for (int i = Rows.Length - 1; i >= 0; i--) { if (Rows[i] != null && Rows[i].Mail != null) { if (Rows[i].Mail.Items.Count > 0 || Rows[i].Mail.Gold > 0) { MirMessageBox messageBox = new MirMessageBox("This parcel contains items or gold. Are you sure you want to delete it?", MirMessageBoxButtons.YesNo); messageBox.YesButton.Click += (o1, e1) => Network.Enqueue(new C.DeleteMail { MailID = Rows[i].Mail.MailID }); messageBox.Show(); } else { Network.Enqueue(new C.DeleteMail { MailID = Rows[i].Mail.MailID }); } } } }; BlockListButton = new MirButton { Index = 520, HoverIndex = 521, PressedIndex = 522, Library = Libraries.CustomPrguse, Parent = this, Location = new Point(183, 414), Sound = SoundList.ButtonA, Hint = "Block List" }; BugReportButton = new MirButton { Index = 523, HoverIndex = 524, PressedIndex = 525, Library = Libraries.CustomPrguse, Parent = this, Location = new Point(210, 414), Sound = SoundList.ButtonA, Hint = "Report Bug" }; BugReportButton.Click += (o, e) => GameScene.Scene.MailComposeLetterDialog.ComposeMail("Icey"); #endregion }
public MailListDialog() { Index = 670; Library = Libraries.Title; Size = new Size(312, 444); Movable = true; Sort = true; Location = new Point((Settings.ScreenWidth - Size.Width) - 150, 5); CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(Size.Width - 27, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); HelpButton = new MirButton { Index = 257, HoverIndex = 258, PressedIndex = 259, Library = Libraries.Prguse2, Parent = this, Location = new Point(Size.Width - 50, 3), Sound = SoundList.ButtonA, }; HelpButton.Click += (o, e) => GameScene.Scene.HelpDialog.DisplayPage(""); PreviousButton = new MirButton { Index = 240, HoverIndex = 241, PressedIndex = 242, Library = Libraries.Prguse2, Parent = this, Location = new Point(102, Size.Height - 55), Sound = SoundList.ButtonA, }; PreviousButton.Click += (o, e) => { if (CurrentPage <= 1) { return; } SelectedMail = null; CurrentPage--; StartIndex -= 10; UpdateInterface(); }; PageLabel = new MirLabel { Text = "", Parent = this, Location = new Point(120, Size.Height - 55), Size = new Size(67, 15), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, }; NextButton = new MirButton { Index = 243, HoverIndex = 244, PressedIndex = 245, Library = Libraries.Prguse2, Parent = this, Location = new Point(192, Size.Height - 55), Sound = SoundList.ButtonA, }; NextButton.Click += (o, e) => { if (CurrentPage >= PageCount) { return; } SelectedMail = null; CurrentPage++; StartIndex += 10; UpdateInterface(); }; #region Action Buttons SendButton = new MirButton { Index = 563, HoverIndex = 564, PressedIndex = 565, Library = Libraries.Prguse, Parent = this, Location = new Point(75, 414), Sound = SoundList.ButtonA, Hint = "发送" }; SendButton.Click += (o, e) => { MirInputBox inputBox = new MirInputBox("请输入收件人名字。"); inputBox.OKButton.Click += (o1, e1) => { //open letter dialog, pass in name GameScene.Scene.MailComposeLetterDialog.ComposeMail(inputBox.InputTextBox.Text); inputBox.Dispose(); }; inputBox.Show(); }; ReplyButton = new MirButton { Index = 569, HoverIndex = 570, PressedIndex = 571, Library = Libraries.Prguse, Parent = this, Location = new Point(102, 414), Sound = SoundList.ButtonA, Hint = "回复" }; ReplyButton.Click += (o, e) => { if (SelectedMail == null) { return; } GameScene.Scene.MailComposeLetterDialog.ComposeMail(SelectedMail.SenderName); }; ReadButton = new MirButton { Index = 572, HoverIndex = 573, PressedIndex = 574, Library = Libraries.Prguse, Parent = this, Location = new Point(129, 414), Sound = SoundList.ButtonA, Hint = "阅读" }; ReadButton.Click += (o, e) => { if (SelectedMail == null) { return; } if (SelectedMail.Gold > 0 || SelectedMail.Items.Count > 0) { GameScene.Scene.MailReadParcelDialog.ReadMail(SelectedMail); } else { GameScene.Scene.MailReadLetterDialog.ReadMail(SelectedMail); } }; DeleteButton = new MirButton { Index = 557, HoverIndex = 558, PressedIndex = 559, Library = Libraries.Prguse, Parent = this, Location = new Point(156, 414), Sound = SoundList.ButtonA, Hint = "删除" }; DeleteButton.Click += (o, e) => { if (SelectedMail == null || SelectedMail.Locked) { return; } if (SelectedMail.Items.Count > 0 || SelectedMail.Gold > 0) { MirMessageBox messageBox = new MirMessageBox("这个包裹包含物品或金币,你确定要删除吗?", MirMessageBoxButtons.YesNo); messageBox.YesButton.Click += (o1, e1) => { Network.Enqueue(new C.DeleteMail { MailID = SelectedMail.MailID }); SelectedMail = null; }; messageBox.Show(); } else { Network.Enqueue(new C.DeleteMail { MailID = SelectedMail.MailID }); SelectedMail = null; } }; BlockListButton = new MirButton { Index = 520, HoverIndex = 521, PressedIndex = 522, Library = Libraries.Prguse, Parent = this, Location = new Point(183, 414), Sound = SoundList.ButtonA, Hint = "黑名单" }; BugReportButton = new MirButton { Index = 523, HoverIndex = 524, PressedIndex = 525, Library = Libraries.Prguse, Parent = this, Location = new Point(210, 414), Sound = SoundList.ButtonA, Hint = "BUG反馈" }; #endregion }
static void Scene_MouseDown(object sender, EventArgs e) { MouseEventArgs ME = e as MouseEventArgs; if (ME == null) { return; } if (ME.Button == MouseButtons.Left) { if (MirItemCell.SelectedCell != null) { if (MirItemCell.SelectedCell.GridType == MirGridType.Equipment || MirItemCell.SelectedCell.GridType == MirGridType.Trade) { MirItemCell.SelectedCell = null; return; } MirMessageBox MMBox = new MirMessageBox( string.Format("Are you sure you want to drop {0}?", MirItemCell.SelectedCell.Item.Info.ItemName), MessageBoxButtons.YesNo); MirItemCell Cell = MirItemCell.SelectedCell; MMBox.YesButton.Click += (O, A) => { OutBound.DropItem(Cell.GridType, Cell.Item.UniqueID); Cell.Item = null; MapObject.User.CalculateWeight(); }; MMBox.Show(); MirItemCell.SelectedCell = null; return; } else if (MirItemCell.PickedUpGold) { MirInputBox MIBox = new MirInputBox("How much do you want to drop?"); MIBox.OKButton.Click += (O, A) => { int Amount; if (int.TryParse(MIBox.InputTextBox.Text, out Amount) && Amount > 0 && Amount <= MapObject.User.Gold) { OutBound.DropGold(Amount); MapObject.User.Gold -= Amount; } MIBox.Dispose(); }; MIBox.Show(); MirItemCell.PickedUpGold = false; return; } } MouseB |= ME.Button; if (ME.Button == MouseButtons.Left) { if (MapObject.MouseObject != MapObject.User && MapObject.MouseObject != null && !MapObject.MouseObject.Dead) { MapObject.TargetObject = MapObject.MouseObject; } else { MapObject.TargetObject = null; } } }