public StorageDialog() { Index = 586; Library = Libraries.Prguse; Location = new Point(0, 0); Sort = true; MirImageControl TitleLabel = new MirImageControl { Index = 0, Library = Libraries.Title, Location = new Point(18, 5), Parent = this }; Storage1Button = new MirButton { HoverIndex = 743, Index = 743, Location = new Point(8, 36), Library = Libraries.Title, Parent = this, PressedIndex = 744, Sound = SoundList.ButtonA, }; Storage1Button.Click += (o, e) => { Storage1Button.Index = 743; Storage1Button.HoverIndex = 743; Storage2Button.Index = 746; Storage2Button.HoverIndex = 746; RentButton.Visible = false; }; Storage2Button = new MirButton { HoverIndex = 746, Index = 746, Location = new Point(80, 36), Library = Libraries.Title, Parent = this, PressedIndex = 746, Sound = SoundList.ButtonA, Visible = false }; Storage2Button.Click += (o, e) => { Storage1Button.Index = 744; Storage1Button.HoverIndex = 744; Storage2Button.Index = 745; Storage2Button.HoverIndex = 745; RentButton.Visible = true; }; RentButton = new MirButton { HoverIndex = 741, Index = 740, Location = new Point(283, 33), Library = Libraries.Title, Parent = this, PressedIndex = 742, Sound = SoundList.ButtonA, Visible = false, }; ProtectButton = new MirButton { HoverIndex = 114, Index = 113, Location = new Point(328, 33), Library = Libraries.Title, Parent = this, PressedIndex = 115, Sound = SoundList.ButtonA, Visible = false }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(363, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); Grid = new MirItemCell[10 * 8]; for (int x = 0; x < 10; x++) { for (int y = 0; y < 8; y++) { Grid[10 * y + x] = new MirItemCell { ItemSlot = 10 * y + x, GridType = MirGridType.Storage, Library = Libraries.Items, Parent = this, Location = new Point(x * 36 + 9 + x, y * 32 + 60 + y), }; } } }
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 void ReadMail(ClientMail mail) { if (mail == null) return; Mail = mail; if (!Mail.Opened) { Network.Enqueue(new C.ReadMail { MailID = Mail.MailID }); } ResetCells(); SenderNameLabel.Text = Mail.SenderName; DateSentLabel.Text = Mail.DateSent.ToString("dd/MM/yy H:mm:ss"); MessageLabel.Text = Mail.Message.Replace("\\r\\n", "\r\n"); GoldSendLabel.Text = Mail.Gold.ToString("###,###,##0"); if (Mail.Items.Count > 0) { for (int i = 0; i < Cells.Length; i++) { if (i >= Mail.Items.Count) break; Cells[i] = new MirItemCell { BorderColour = Color.Lime, Size = new Size(35, 31), GridType = MirGridType.Mail, Library = Libraries.Items, Parent = this, Location = new Point(27 + (i * 36), 311), ItemSlot = i, Item = Mail.Items[i] }; } } if (!Mail.Collected) { CollectButton.Index = 683; CollectButton.HoverIndex = 684; CollectButton.PressedIndex = 685; CollectButton.Enabled = false; } else { CollectButton.Index = 680; CollectButton.HoverIndex = 681; CollectButton.PressedIndex = 682; CollectButton.Enabled = true; } Visible = true; }
public GuildDialog() { Index = 180; Library = Libraries.Prguse; Movable = true; Sort = true; Location = Center; #region TabUI NoticeButton = new MirButton { Library = Libraries.Title, Index = 93, PressedIndex = 94, Sound = SoundList.ButtonA, Parent = this, Location = new Point(20, 38) }; NoticeButton.Click += (o, e) => LeftDialog(0); MembersButton = new MirButton { Library = Libraries.Title, Index = 99, PressedIndex = 100, Sound = SoundList.ButtonA, Parent = this, Location = new Point(91, 38), }; MembersButton.Click += (o, e) => LeftDialog(1); StorageButton = new MirButton { Library = Libraries.Title, Index = 105, PressedIndex = 106, Sound = SoundList.ButtonA, Parent = this, Location = new Point(162, 38), Visible = false }; StorageButton.Click += (o, e) => LeftDialog(2); BuffsButton = new MirButton { Library = Libraries.Title, Index = 526, HoverIndex = 527, PressedIndex = 528, Sound = SoundList.ButtonA, Parent = StatusPage, Location = new Point(124, 63), Visible = false, }; BuffsButton.Click += (o, e) => { GameScene.Scene.GuildBuffDialog.Show(); Hide(); }; RankButton = new MirButton // Ranks { Library = Libraries.Title, Index = 101, HoverIndex = 102, Sound = SoundList.ButtonA, Parent = this, Location = new Point(233, 38), Visible = false, }; RankButton.Click += (o, e) => LeftDialog(3); CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(565, 4), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA }; CloseButton.Click += (o, e) => Hide(); #endregion #endregion #region NoticePageUI NoticePage = new MirImageControl() { Parent = this, Size = new Size(352, 372), Location = new Point(0, 60), Visible = true }; Notice = new MirTextBox() { ForeColour = Color.White, Font = new Font(Settings.FontName, 8F), Enabled = false, Visible = true, Parent = NoticePage, Size = new Size(322, 330), Location = new Point(13, 1) //sorting = true }; Notice.MultiLine(); NoticeEditButton = new MirButton { Visible = false, Index = 560, HoverIndex = 561, PressedIndex = 562, Library = Libraries.Prguse, Sound = SoundList.ButtonA, Parent = NoticePage, Location = new Point(20, 342) }; NoticeEditButton.Click += (o, e) => EditNotice(); NoticeSaveButton = new MirButton { Visible = false, Index = 554, HoverIndex = 555, PressedIndex = 556, Library = Libraries.Prguse, Sound = SoundList.ButtonA, Parent = NoticePage, Location = new Point(20, 342) }; NoticeSaveButton.Click += (o, e) => EditNotice(); NoticeUpButton = new MirButton { HoverIndex = 198, Index = 197, Visible = true, Library = Libraries.Prguse2, Location = new Point(337, 1), Size = new Size(16, 14), Parent = NoticePage, PressedIndex = 199, Sound = SoundList.ButtonA }; NoticeUpButton.Click += (o, e) => { if (NoticeScrollIndex == 0) return; if (NoticeScrollIndex >= 25) NoticeScrollIndex -= 24; NoticeScrollIndex--; UpdateNotice(); }; NoticeDownButton = new MirButton { HoverIndex = 208, Index = 207, Visible = true, Library = Libraries.Prguse2, Location = new Point(337, 318), Size = new Size(16, 14), Parent = NoticePage, PressedIndex = 209, Sound = SoundList.ButtonA }; NoticeDownButton.Click += (o, e) => { if (NoticeScrollIndex == Notice.MultiText.Length - 1) return; if (NoticeScrollIndex < 25) NoticeScrollIndex = 24; NoticeScrollIndex++; UpdateNotice(); }; NoticePositionBar = new MirButton { Index = 206, Library = Libraries.Prguse2, Location = new Point(336, 15), Parent = NoticePage, Movable = true, Visible = true, Sound = SoundList.None }; NoticePositionBar.OnMoving += NoticePositionBar_OnMoving; NoticePage.KeyDown += NoticePanel_KeyDown; NoticePage.MouseWheel += NoticePanel_MouseWheel; #endregion #region MembersPageUI MembersPage = new MirImageControl() { Parent = this, Size = new Size(330, 372), Location = new Point(0, 60), Visible = false }; MembersPageBase = new MirImageControl() { Library = Libraries.Prguse, Index = 1852, Parent = MembersPage, Location = new Point(13, 1), Visible = true }; MembersPage.BeforeDraw += (o, e) => RequestUpdateMembers(); MembersRanks = new MirDropDownBox[MemberPageRows]; MembersName = new MirLabel[MemberPageRows]; MembersStatus = new MirLabel[MemberPageRows]; MembersDelete = new MirButton[MemberPageRows]; for (int i = MembersRanks.Length - 1; i >= 0; i--) { int index = i; MembersRanks[i] = new MirDropDownBox() { BackColour = i % 2 == 0 ? Color.FromArgb(255, 10, 10, 10) : Color.FromArgb(255, 15, 15, 15), ForeColour = Color.White, Parent = MembersPage, Size = new Size(100, 14), Location = new Point(24, 30 + (i * 15)), Visible = false, Enabled = false }; MembersRanks[index].ValueChanged += (o, e) => OnNewRank(index, MembersRanks[index]._WantedIndex); } for (int i = 0; i < MembersName.Length; i++) { MembersName[i] = new MirLabel() { BackColour = i % 2 == 0 ? Color.FromArgb(255, 05, 05, 05) : Color.FromArgb(255, 07, 07, 07), ForeColour = Color.White, Parent = MembersPage, Size = new Size(100, 14), Location = new Point(125, 30 + (i * 15)), Visible = false, Enabled = false, Font = new Font(Settings.FontName, 7F) }; } for (int i = 0; i < MembersStatus.Length; i++) { MembersStatus[i] = new MirLabel() { BackColour = i % 2 == 0 ? Color.FromArgb(255, 10, 10, 10) : Color.FromArgb(255, 15, 15, 15), ForeColour = Color.White, Parent = MembersPage, Size = new Size(100, 14), Location = new Point(225, 30 + (i * 15)), Visible = false, Enabled = false, Font = new Font(Settings.FontName, 7F) }; } for (int i = 0; i < MembersDelete.Length; i++) { int index = i; MembersDelete[i] = new MirButton() { Enabled = true, Visible = true, Location = new Point(210, 30 + (i * 15)), Library = Libraries.Prguse, Index = 917, Parent = MembersPage }; MembersDelete[index].Click += (o, e) => DeleteMember(index); } MembersUpButton = new MirButton { HoverIndex = 198, Index = 197, Visible = true, Library = Libraries.Prguse2, Location = new Point(315, 0), Size = new Size(16, 14), Parent = MembersPage, PressedIndex = 199, Sound = SoundList.ButtonA }; MembersUpButton.Click += (o, e) => { if (MemberScrollIndex == 0) return; MemberScrollIndex--; UpdateMembers(); UpdateMembersScrollPosition(); }; MembersDownButton = new MirButton { HoverIndex = 208, Index = 207, Visible = true, Library = Libraries.Prguse2, Location = new Point(315, 316), Size = new Size(16, 14), Parent = MembersPage, PressedIndex = 209, Sound = SoundList.ButtonA }; MembersDownButton.Click += (o, e) => { if (MemberScrollIndex == MembersShowCount - MemberPageRows) return; MemberScrollIndex++; UpdateMembers(); UpdateMembersScrollPosition(); }; MembersPositionBar = new MirButton { Index = 955, Library = Libraries.Prguse, Location = new Point(315, 15), Parent = MembersPage, Movable = true, Sound = SoundList.None }; MembersPositionBar.OnMoving += MembersPositionBar_OnMoving; MembersShowOfflineButton = new MirButton { Visible = true, Index = 1346, Library = Libraries.Prguse, Sound = SoundList.ButtonA, Parent = MembersPage, Location = new Point(230, 310) }; MembersShowOfflineButton.Click += (o, e) => MembersShowOfflineSwitch(); MembersShowOfflineStatus = new MirImageControl { Visible = true, Index = 1347, Library = Libraries.Prguse, Parent = MembersPage, Location = new Point(230, 310) }; MembersShowOfflineStatus.Click += (o, e) => MembersShowOfflineSwitch(); MembersShowOffline = new MirLabel { Visible = true, Text = "Show Offline", Location = new Point(245, 309), Parent = MembersPage, Size = new Size(150, 12), Font = new Font(Settings.FontName, 7F), ForeColour = Color.White }; MembersPage.KeyDown += MembersPanel_KeyDown; MembersPage.MouseWheel += MembersPanel_MouseWheel; #endregion #region StatusDialogUI StatusPage = new MirImageControl() { Parent = this, Size = new Size(230, 372), Location = new Point(355, 60), Visible = true }; StatusPageBase = new MirImageControl() { Parent = StatusPage, Library = Libraries.Prguse, Index = 1850, Visible = true, Location = new Point(10, 2) }; StatusPage.BeforeDraw += (o, e) => { if (MapControl.User.GuildName == "") StatusData.Text = ""; else StatusData.Text = string.Format("{0}\n\n{1}\n\n{2}/{3}", MapObject.User.GuildName, Level, MemberCount, MaxMembers == 0 ? "Unlimited" : MaxMembers.ToString()); }; StatusHeaders = new MirLabel() { Location = new Point(46, 49), Size = new Size(100, 300), NotControl = true, Text = "Guild Name\n\nLevel\n\nMembers", Visible = true, Parent = StatusPage }; StatusData = new MirLabel() { Location = new Point(122, 49), Size = new Size(100, 300), NotControl = true, Text = "", Visible = true, Parent = StatusPage }; StatusExpBar = new MirImageControl() { //Index = 7, Library = Libraries.Prguse, Location = new Point(0, 0), DrawImage = false, NotControl = true, Parent = StatusPage, Size = new Size(550, 7) }; StatusExpBar.BeforeDraw += StatusExpBar_BeforeDraw; StatusExpLabel = new MirLabel() { DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Location = new Point(0, 0), NotControl = true, Parent = StatusPage, Size = new Size(550, 12) }; MembersRecruitName = new MirTextBox() { Location = new Point(40, 300), Size = new Size(130, 21), MaxLength = 20, Parent = StatusPage, Visible = true, Text = "", BackColour = Color.FromArgb(255, 6, 6, 6), Border = true, BorderColour = Color.FromArgb(255, 20, 20, 20), CanLoseFocus = true //sorting = true }; RecruitMemberButton = new MirButton() { Parent = StatusPage, Enabled = true, Visible = true, Location = new Point(170, 299), Library = Libraries.Title, Index = 356, HoverIndex = 357, PressedIndex = 358 }; RecruitMemberButton.Click += (o, e) => AddMember(); #endregion #region StorageDialogUI StoragePage = new MirImageControl() { Parent = this, Size = new Size(352, 372), Location = new Point(0, 60), Visible = false }; StoragePageBase = new MirImageControl() { Visible = true, Parent = StoragePage, Library = Libraries.Prguse, Index = 1851, Location = new Point(30, 19) }; StoragePage.BeforeDraw += (o, e) => { StorageGoldText.Text = Gold > 0 ? string.Format("{0:###,###,###}", Gold) : "0"; if (MyRankId == 0) StorageGoldRemove.Visible = true; else StorageGoldRemove.Visible = false; }; StorageGoldText = new MirLabel() { Parent = StoragePage, Size = new Size(125, 12), Location = new Point(194, 312), Visible = true, Text = "0", NotControl = true, }; StorageGoldAdd = new MirButton() { Parent = StoragePage, Library = Libraries.Prguse, Index = 918, Visible = true, Enabled = true, Location = new Point(306, 313) }; StorageGoldAdd.Click += (o, e) => StorageAddGold(); StorageGoldRemove = new MirButton() { Visible = false, Enabled = true, Location = new Point(218, 10) }; StorageGoldRemove.Click += (o, e) => StorageRemoveGold(); StorageGrid = new MirItemCell[8 * 8]; { for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { int idx = 8 * y + x; StorageGrid[idx] = new MirItemCell { ItemSlot = idx, GridType = MirGridType.GuildStorage, Library = Libraries.Items, Parent = StoragePage, Size = new Size(35, 35), Location = new Point(x * 35 + 31 + x, y * 35 + 20 + y), }; } } } #endregion #region RankDialogUI RankPage = new MirImageControl() { Parent = this, Size = new Size(352, 372), Location = new Point(0, 60), Visible = false }; RankPage.BeforeDraw += (o, e) => RequestUpdateMembers(); RanksSelectTextL = new MirLabel() { Text = "Edit Rank", Location = new Point(42,36), Size = new Size(150, 20), ForeColour = Color.White, Parent = RankPage, NotControl = true, }; RanksSelectTextR = new MirLabel() { Text = "Select Rank", Location = new Point(198, 36), Size = new Size(150, 20), ForeColour = Color.White, Parent = RankPage, NotControl = true, }; RanksSelectBox = new MirDropDownBox() { Parent = RankPage, Location = new Point(198, 36), Size = new Size(130, 16), ForeColour = Color.White, Visible = true, Enabled = true }; RanksSelectBox.ValueChanged += (o, e) => OnRankSelect(RanksSelectBox._WantedIndex); RanksName = new MirTextBox() { Location = new Point(42, 36), Size = new Size(130, 16), MaxLength = 20, Parent = RankPage, Visible = true, Enabled = false, Text = "", BackColour = Color.FromArgb(255, 6, 6, 6), Border = true, BorderColour = Color.FromArgb(255, 20, 20, 20) }; RanksName.BeforeDraw += (o, e) => RanksName_BeforeDraw(); RanksName.TextBox.KeyPress += RanksName_KeyPress; RanksSaveName = new MirButton() { Location = new Point(155, 290), Enabled = false, Visible = true, Parent = RankPage, Index = 90, HoverIndex = 91, PressedIndex = 92, Library = Libraries.Title, Sound = SoundList.ButtonA }; RanksSaveName.Click += (o, e) => { RanksChangeName(); }; String[] Options = { "Edit ranks", "Recruit member", "Kick member", "Store item", "Retrieve item", "Alter alliance", "Change notice", "Activate Buff" }; RanksOptionsButtons = new MirButton[8]; RanksOptionsStatus = new MirImageControl[8]; RanksOptionsTexts = new MirLabel[8]; for (int i = 0; i < RanksOptionsButtons.Length; i++) { RanksOptionsButtons[i] = new MirButton() { Visible = true, Enabled = false, Index = 1346, Library = Libraries.Prguse, Sound = SoundList.ButtonA, Parent = RankPage, Location = new Point(i % 2 == 0 ? 32 : 202, i % 2 == 0 ? 120 + (i * 20) : 120 + ((i - 1) * 20)) }; int index = i; RanksOptionsButtons[i].Click += (o, e) => SwitchRankOption(index); } for (int i = 0; i < RanksOptionsStatus.Length; i++) { RanksOptionsStatus[i] = new MirImageControl() { Visible = false, Index = 1347, Library = Libraries.Prguse, Parent = RankPage, NotControl = true, Location = new Point(i % 2 == 0 ? 32 : 202, i % 2 == 0 ? 120 + (i * 20) : 120 + ((i - 1) * 20)) }; int index = i; RanksOptionsStatus[i].Click += (o, e) => SwitchRankOption(index); } for (int i = 0; i < RanksOptionsTexts.Length; i++) { RanksOptionsTexts[i] = new MirLabel() { Visible = true, NotControl = true, Parent = RankPage, Location = new Point(17 + (i % 2 == 0 ? 32 : 202), i % 2 == 0 ? 118 + (i * 20) : 118 + ((i - 1) * 20)), AutoSize = true, Text = Options[i] }; } }
private void RefreshItem(S.RefreshItem p) { Bind(p.Item); if (SelectedCell != null && SelectedCell.Item.UniqueID == p.Item.UniqueID) SelectedCell = null; if (HoverItem != null && HoverItem.UniqueID == p.Item.UniqueID) { DisposeItemLabel(); CreateItemLabel(p.Item); } for (int i = 0; i < User.Inventory.Length; i++) if (User.Inventory[i] != null && User.Inventory[i].UniqueID == p.Item.UniqueID) { User.Inventory[i] = p.Item; User.RefreshStats(); return; } for (int i = 0; i < User.Equipment.Length; i++) if (User.Equipment[i] != null && User.Equipment[i].UniqueID == p.Item.UniqueID) { User.Equipment[i] = p.Item; User.RefreshStats(); return; } }
private void Confirm() { if (TargetItem == null) return; switch (PType) { case PanelType.Sell: if (TargetItem.Info.Bind.HasFlag(BindMode.DontSell)) { GameScene.Scene.ChatDialog.ReceiveChat("Cannot sell this item.", ChatType.System); return; } if (GameScene.Gold + TargetItem.Price() / 2 <= uint.MaxValue) { Network.Enqueue(new C.SellItem { UniqueID = TargetItem.UniqueID, Count = TargetItem.Count }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat("Cannot carry anymore gold.", ChatType.System); break; case PanelType.Repair: if (TargetItem.Info.Bind.HasFlag(BindMode.DontRepair)) { GameScene.Scene.ChatDialog.ReceiveChat("Cannot repair this item.", ChatType.System); return; } if (GameScene.Gold >= TargetItem.RepairPrice() * GameScene.NPCRate) { Network.Enqueue(new C.RepairItem { UniqueID = TargetItem.UniqueID }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat("You do not have enough gold.", ChatType.System); break; case PanelType.SpecialRepair: if ((TargetItem.Info.Bind.HasFlag(BindMode.DontRepair)) || (TargetItem.Info.Bind.HasFlag(BindMode.NoSRepair))) { GameScene.Scene.ChatDialog.ReceiveChat("Cannot repair this item.", ChatType.System); return; } if (GameScene.Gold >= (TargetItem.RepairPrice() * 3) * GameScene.NPCRate) { Network.Enqueue(new C.SRepairItem { UniqueID = TargetItem.UniqueID }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat("You do not have enough gold.", ChatType.System); break; case PanelType.Consign: if (TargetItem.Info.Bind.HasFlag(BindMode.DontStore)) { GameScene.Scene.ChatDialog.ReceiveChat("Cannot store this item.", ChatType.System); return; } MirAmountBox box = new MirAmountBox("Consignment Price:", TargetItem.Image, Globals.MaxConsignment, Globals.MinConsignment) { InputTextBox = { Text = string.Empty }, Amount = 0 }; box.Show(); box.OKButton.Click += (o, e) => { Network.Enqueue(new C.ConsignItem { UniqueID = TargetItem.UniqueID, Price = box.Amount }); TargetItem = null; }; return; case PanelType.Disassemble: Network.Enqueue(new C.DisassembleItem { UniqueID = TargetItem.UniqueID }); break; case PanelType.Downgrade: Network.Enqueue(new C.DowngradeAwakening { UniqueID = TargetItem.UniqueID }); break; case PanelType.Reset: if (TargetItem.Info.NeedIdentify == false) { Network.Enqueue(new C.ResetAddedItem { UniqueID = TargetItem.UniqueID }); } break; case PanelType.Refine: for (int i = 0; i < GameScene.Scene.RefineDialog.Grid.Length; i++) { if (GameScene.Scene.RefineDialog.Grid[i].Item != null) { if (GameScene.Gold >= ((TargetItem.Info.RequiredAmount * 10) * GameScene.NPCRate)) { Network.Enqueue(new C.RefineItem { UniqueID = TargetItem.UniqueID }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat(String.Format("You don't have enough gold to refine your {0}.", TargetItem.FriendlyName), ChatType.System); return; } } GameScene.Scene.ChatDialog.ReceiveChat(String.Format("You haven't deposited any items to refine your {0} with.", TargetItem.FriendlyName), ChatType.System); break; case PanelType.CheckRefine: if (TargetItem.RefineAdded == 0) { GameScene.Scene.ChatDialog.ReceiveChat(String.Format("Your {0} hasn't been refined so it doesn't need checking.", TargetItem.FriendlyName), ChatType.System); return; } Network.Enqueue(new C.CheckRefine { UniqueID = TargetItem.UniqueID }); break; case PanelType.ReplaceWedRing: if (TargetItem.Info.Type != ItemType.Ring) { GameScene.Scene.ChatDialog.ReceiveChat(String.Format("{0} isn't a ring.", TargetItem.FriendlyName), ChatType.System); return; } Network.Enqueue(new C.ReplaceWedRing { UniqueID = TargetItem.UniqueID }); break; } TargetItem = null; OldCell.Locked = false; OldCell = null; }
public void Hide() { if (OldCell != null) { OldCell.Locked = false; TargetItem = null; OldCell = null; } Visible = false; }
public InventoryDialog() { Index = 196; Library = Libraries.Title; Movable = true; Sort = true; Visible = false; WeightBar = new MirImageControl { Index = 24, Library = Libraries.Prguse, Location = new Point(182, 217), Parent = this, DrawImage = false, NotControl = true, }; ItemButton = new MirButton { Index = 197, Library = Libraries.Title, Location = new Point(6, 7), Parent = this, Size = new Size(96, 23), Sound = SoundList.ButtonA, }; ItemButton.Click += Button_Click; QuestButton = new MirButton { Index = -1, Library = Libraries.Title, Location = new Point(101, 7), Parent = this, Size = new Size(96,23), Sound = SoundList.ButtonA, }; QuestButton.Click += Button_Click; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(289, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); GoldLabel = new MirLabel { Parent = this, Location = new Point(40, 212), Size = new Size(111, 14), Sound = SoundList.Gold, }; GoldLabel.Click += (o, e) => { if (GameScene.SelectedCell == null) GameScene.PickedUpGold = !GameScene.PickedUpGold && GameScene.Gold > 0; }; Grid = new MirItemCell[8 * 5]; for (int x = 0; x < 8; x++) { for (int y = 0; y < 5; y++) { Grid[8 * y + x] = new MirItemCell { ItemSlot = 8 * y + x, GridType = MirGridType.Inventory, Library = Libraries.Items, Parent = this, Location = new Point(x * 36 + 9 + x, y * 32 + 37 + y), }; } } QuestGrid = new MirItemCell[8 * 5]; for (int x = 0; x < 8; x++) { for (int y = 0; y < 5; y++) { QuestGrid[8 * y + x] = new MirItemCell { ItemSlot = 8 * y + x, GridType = MirGridType.QuestInventory, Library = Libraries.Items, Parent = this, Location = new Point(x * 36 + 9 + x, y * 32 + 37 + y), Visible = false }; } } WeightLabel = new MirLabel { Parent = this, Location = new Point(268, 212), Size = new Size(26, 14) }; WeightBar.BeforeDraw += WeightBar_BeforeDraw; }
private void Confirm() { if (TargetItem == null) return; switch (PType) { case PanelType.Sell: if (TargetItem.Info.Bind.HasFlag(BindMode.DontSell)) { GameScene.Scene.ChatDialog.ReceiveChat("Cannot sell this item.", ChatType.System); return; } if (GameScene.Gold + TargetItem.Price() / 2 <= uint.MaxValue) { Network.Enqueue(new C.SellItem { UniqueID = TargetItem.UniqueID, Count = TargetItem.Count }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat("Cannot carry anymore gold.", ChatType.System); break; case PanelType.Repair: if (TargetItem.Info.Bind.HasFlag(BindMode.DontRepair)) { GameScene.Scene.ChatDialog.ReceiveChat("Cannot repair this item.", ChatType.System); return; } if (GameScene.Gold >= TargetItem.RepairPrice() * GameScene.NPCRate) { Network.Enqueue(new C.RepairItem { UniqueID = TargetItem.UniqueID }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat("You do not have enough gold.", ChatType.System); break; case PanelType.SpecialRepair: if (TargetItem.Info.Bind.HasFlag(BindMode.DontRepair)) { GameScene.Scene.ChatDialog.ReceiveChat("Cannot repair this item.", ChatType.System); return; } if (GameScene.Gold >= (TargetItem.RepairPrice() * 3) * GameScene.NPCRate) { Network.Enqueue(new C.SRepairItem { UniqueID = TargetItem.UniqueID }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat("You do not have enough gold.", ChatType.System); break; case PanelType.Consign: if (TargetItem.Info.Bind.HasFlag(BindMode.DontStore)) { GameScene.Scene.ChatDialog.ReceiveChat("Cannot store this item.", ChatType.System); return; } MirAmountBox box = new MirAmountBox("Consignment Price:", TargetItem.GetRealItemImage(), Globals.MaxConsignment, Globals.MinConsignment) { InputTextBox = { Text = string.Empty }, Amount = 0 }; box.Show(); box.OKButton.Click += (o, e) => { Network.Enqueue(new C.ConsignItem { UniqueID = TargetItem.UniqueID, Price = box.Amount }); TargetItem = null; }; return; case PanelType.Disassemble: Network.Enqueue(new C.DisassembleItem { UniqueID = TargetItem.UniqueID }); break; case PanelType.Downgrade: Network.Enqueue(new C.DowngradeAwakening { UniqueID = TargetItem.UniqueID }); break; case PanelType.Reset: if (TargetItem.Info.NeedIdentify == false) { Network.Enqueue(new C.ResetAddedItem { UniqueID = TargetItem.UniqueID }); } break; } TargetItem = null; OldCell.Locked = false; OldCell = null; }
private void ItemCell_Click() { if (OldCell != null) { OldCell.Locked = false; TargetItem = null; OldCell = null; } if (GameScene.SelectedCell == null || GameScene.SelectedCell.GridType != MirGridType.Inventory || (PType != PanelType.Sell && PType != PanelType.Consign && GameScene.SelectedCell.Item != null && GameScene.SelectedCell.Item.Info.Durability == 0)) return; if (GameScene.SelectedCell.Item != null && (GameScene.SelectedCell.Item.Info.StackSize > 1 && GameScene.SelectedCell.Item.Count > 1)) { MirAmountBox amountBox = new MirAmountBox("Sell Amount:", GameScene.SelectedCell.Item.Info.Image, GameScene.SelectedCell.Item.Count); amountBox.OKButton.Click += (o, a) => { TargetItem = GameScene.SelectedCell.Item.Clone(); TargetItem.Count = amountBox.Amount; OldCell = GameScene.SelectedCell; OldCell.Locked = true; GameScene.SelectedCell = null; if (Hold) Confirm(); }; amountBox.Show(); } else { TargetItem = GameScene.SelectedCell.Item; OldCell = GameScene.SelectedCell; OldCell.Locked = true; GameScene.SelectedCell = null; if (Hold) Confirm(); } }
public InspectDialog() { Index = 430; Library = Libraries.Prguse; Location = new Point(536, 0); Movable = true; Sort = true; CharacterPage = new MirImageControl { Index = 345, Parent = this, Library = Libraries.Prguse, Location = new Point(8, 90), }; CharacterPage.AfterDraw += (o, e) => { if (Libraries.StateItems == null) return; ItemInfo RealItem; if (ArmorCell.Item != null) { RealItem = Functions.GetRealItem(ArmorCell.Item.Info, Level, Class, GameScene.ItemInfoList); Libraries.StateItems.Draw(RealItem.Image, DisplayLocation, Color.White, true, 1F); } if (WeaponCell.Item != null) { RealItem = Functions.GetRealItem(WeaponCell.Item.Info, Level, Class, GameScene.ItemInfoList); Libraries.StateItems.Draw(RealItem.Image, DisplayLocation, Color.White, true, 1F); } if (HelmetCell.Item != null) Libraries.StateItems.Draw(HelmetCell.Item.Info.Image, DisplayLocation, Color.White, true, 1F); else Libraries.Prguse.Draw(440 + Hair + (Gender == MirGender.Male ? 0 : 40), DisplayLocation, Color.White, true, 1F); }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(241, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); GroupButton = new MirButton { HoverIndex = 432, Index = 431, Location = new Point(85, 379), Library = Libraries.Prguse, Parent = this, PressedIndex = 433, Sound = SoundList.ButtonA, }; GroupButton.Click += (o, e) => { if (GroupDialog.GroupList.Count >= Globals.MaxGroup) { GameScene.Scene.ChatDialog.ReceiveChat("Your group already has the maximum number of members.", ChatType.System); return; } if (GroupDialog.GroupList.Count > 0 && GroupDialog.GroupList[0] != MapObject.User.Name) { GameScene.Scene.ChatDialog.ReceiveChat("You are not the leader of your group.", ChatType.System); return; } Network.Enqueue(new C.AddMember { Name = Name }); }; FriendButton = new MirButton { HoverIndex = 435, Index = 434, Location = new Point(115, 379), Library = Libraries.Prguse, Parent = this, PressedIndex = 436, Sound = SoundList.ButtonA, }; MailButton = new MirButton { HoverIndex = 438, Index = 437, Location = new Point(145, 379), Library = Libraries.Prguse, Parent = this, PressedIndex = 439, Sound = SoundList.ButtonA, }; TradeButton = new MirButton { HoverIndex = 524, Index = 523, Location = new Point(175, 379), Library = Libraries.Prguse, Parent = this, PressedIndex = 525, Sound = SoundList.ButtonA, }; TradeButton.Click += (o, e) => { Network.Enqueue(new C.TradeRequest()); }; NameLabel = new MirLabel { DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(50, 12), Size = new Size(190, 20), }; NameLabel.Click += (o, e) => { GameScene.Scene.ChatDialog.ChatTextBox.SetFocus(); GameScene.Scene.ChatDialog.ChatTextBox.Text = string.Format("/{0} ", Name); GameScene.Scene.ChatDialog.ChatTextBox.Visible = true; GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionLength = 0; GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionStart = Name.Length + 2; }; GuildLabel = new MirLabel { DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(50, 33), Size = new Size(190, 30), NotControl = true, }; ClassImage = new MirImageControl { Index = 100, Library = Libraries.Prguse, Location = new Point(15, 33), Parent = this, NotControl = true, }; WeaponCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Weapon, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(125, 7), }; ArmorCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Armour, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(164, 7), }; HelmetCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Helmet, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 7), }; TorchCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Torch, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 134), }; NecklaceCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Necklace, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 98), }; BraceletLCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.BraceletL, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(8, 170), }; BraceletRCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.BraceletR, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 170), }; RingLCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.RingL, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(8, 206), }; RingRCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.RingR, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 206), }; AmuletCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Amulet, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(8, 241), }; BootsCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Boots, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(47, 241), }; BeltCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Belt, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(86, 241), }; StoneCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Stone, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(125, 241), }; }
private void Confirm() { switch (PType) { case PanelType.Sell: if (GameScene.Gold + TargetItem.Price() / 2 <= uint.MaxValue) { Network.Enqueue(new C.SellItem { UniqueID = TargetItem.UniqueID, Count = TargetItem.Count }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat("Cannot carry anymore gold.", ChatType.System); break; case PanelType.Repair: if (GameScene.Gold >= TargetItem.RepairPrice()*GameScene.NPCRate) { Network.Enqueue(new C.RepairItem { UniqueID = TargetItem.UniqueID }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat("You do not have enough gold.", ChatType.System); break; case PanelType.SpecialRepair: if (GameScene.Gold >= (TargetItem.RepairPrice() * 3) * GameScene.NPCRate) { Network.Enqueue(new C.SRepairItem { UniqueID = TargetItem.UniqueID }); TargetItem = null; return; } GameScene.Scene.ChatDialog.ReceiveChat("You do not have enough gold.", ChatType.System); break; case PanelType.Consign: MirAmountBox box = new MirAmountBox("Consignment Price:", TargetItem.Info.Image, Globals.MaxConsignment, Globals.MinConsignment) { InputTextBox = {Text = string.Empty}, Amount = 0 }; box.Show(); box.OKButton.Click += (o, e) => { Network.Enqueue(new C.ConsignItem {UniqueID = TargetItem.UniqueID, Price = box.Amount}); TargetItem = null; }; return; } TargetItem = null; OldCell.Locked = false; OldCell = null; }
public NPCAwakeDialog() { Index = 710; Library = Libraries.Title; Location = new Point(0, 0); Sort = true; Movable = true; GoldLabel = new MirLabel { AutoSize = true, Location = new Point(112, 354), Parent = this, NotControl = true, }; NeedItemLabel1 = new MirLabel { AutoSize = true, Location = new Point(67, 317),// Parent = this, NotControl = true, }; NeedItemLabel2 = new MirLabel { AutoSize = true, Location = new Point(192, 317),//(155, 316), Parent = this, NotControl = true, }; UpgradeButton = new MirButton { HoverIndex = 713, Index = 712, Location = new Point(115, 391), //new Point(181, 135), Library = Libraries.Title, Parent = this, PressedIndex = 714, Sound = SoundList.ButtonA, }; UpgradeButton.Click += (o, e) => Awakening(); CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(284, 4), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); ItemCells[0] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(202, 91), ItemSlot = 0, }; //ItemCells[0].AfterDraw += (o, e) => ItemCell_AfterDraw(); //ItemCells[0].Click += (o, e) => ItemCell_Click(); ItemCells[1] = new MirItemCell //Required { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(31, 316), ItemSlot = 1, Enabled = false, }; ItemCells[2] = new MirItemCell //Required { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(155, 316), ItemSlot = 2, Enabled = false, }; ItemCells[3] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(175, 199), ItemSlot = 3, }; ItemCells[4] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(230, 199), ItemSlot = 4, }; ItemCells[5] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(175, 256), ItemSlot = 5, }; ItemCells[6] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(230, 256), ItemSlot = 6, }; SelectAwakeType = new MirDropDownBox() { Parent = this, Location = new Point(35, 141), Size = new Size(109, 14), ForeColour = Color.White, Visible = true, Enabled = true, }; SelectAwakeType.ValueChanged += (o, e) => OnAwakeTypeSelect(SelectAwakeType._WantedIndex); }
public MailComposeParcelDialog() { Index = 674; Library = Libraries.Title; Size = new Size(236, 384); Movable = true; Sort = true; Location = new Point(GameScene.Scene.InventoryDialog.Size.Width + 10, 0); 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) => { ResetLockedCells(); Hide(); }; RecipientNameLabel = new MirLabel { Text = "", Parent = this, Font = new Font(Settings.FontName, 8F), ForeColour = Color.White, Location = new Point(70, 35), Size = new Size(150, 15), NotControl = true, }; MessageTextBox = new MirTextBox { ForeColour = Color.White, Parent = this, Font = new Font(Settings.FontName, 8F), Location = new Point(15, 98), Size = new Size(202, 165), }; MessageTextBox.MultiLine(); StampButton = new MirButton { Index = 203, HoverIndex = 203, PressedIndex = 203, Location = new Point(73, 56), Size = new Size(20,20), Library = Libraries.Prguse2, Parent = this, Sound = SoundList.ButtonA, }; StampButton.Click += (o, e) => { StampParcel(); }; ItemCover = new MirImageControl { Index = 676, Location = new Point(63, 310), Size = new Size(144, 33), Library = Libraries.Title, Parent = this }; for (int i = 0; i < Cells.Length; i++) { Cells[i] = new MirItemCell { BorderColour = Color.Lime, Size = new Size(35, 31), GridType = MirGridType.Mail, Library = Libraries.Items, Parent = this, Location = new Point(27 + (i * 36), 311), ItemSlot = i }; } ParcelCostLabel = new MirLabel { DrawFormat = TextFormatFlags.VerticalCenter, Font = new Font(Settings.FontName, 8F), Location = new Point(63, 269), Parent = this, Size = new Size(143, 15), }; GoldSendLabel = new MirLabel { DrawFormat = TextFormatFlags.VerticalCenter, Font = new Font(Settings.FontName, 8F), Location = new Point(63, 290), Parent = this, Size = new Size(143, 15), Sound = SoundList.Gold, }; GoldSendLabel.Click += (o, e) => { if (GameScene.SelectedCell == null && GameScene.Gold > 0) { MirAmountBox amountBox = new MirAmountBox("Send Amount:", 116, GameScene.Gold); amountBox.OKButton.Click += (c, a) => { if (amountBox.Amount > 0) { GiftGoldAmount += amountBox.Amount; GameScene.Gold -= amountBox.Amount; } GoldSendLabel.Text = GiftGoldAmount.ToString("###,###,##0"); CalculatePostage(); }; amountBox.Show(); GameScene.PickedUpGold = false; } }; SendButton = new MirButton { Index = 607, HoverIndex = 608, PressedIndex = 609, Parent = this, Library = Libraries.Title, Sound = SoundList.ButtonA, Location = new Point(30, 350) }; SendButton.Click += (o, e) => { Network.Enqueue(new C.SendMail { Name = RecipientNameLabel.Text, Message = MessageTextBox.Text, Gold = GiftGoldAmount, ItemsIdx = ItemsIdx, Stamped = Stamped }); }; CancelButton = new MirButton { Index = 193, HoverIndex = 194, PressedIndex = 195, Parent = this, Library = Libraries.Title, Sound = SoundList.ButtonA, Location = new Point(135, 350) }; CancelButton.Click += (o, e) => { ResetLockedCells(); Hide(); }; }
public InspectDialog() { Index =430; Library = Libraries.Prguse; Location = new Point(536, 0); Movable = true; Sort = true; CharacterPage = new MirImageControl { Index = 340, Parent = this, Library = Libraries.Prguse, Location = new Point(8, 70), }; CharacterPage.AfterDraw += (o, e) => { if (Libraries.StateItems == null) return; ItemInfo RealItem = null; if (ArmorCell.Item != null) { RealItem = Functions.GetRealItem(ArmorCell.Item.Info, Level, Class, GameScene.ItemInfoList); Libraries.StateItems.Draw(RealItem.Image, new Point(DisplayLocation.X + 0, DisplayLocation.Y + -20), Color.White, true, 1F); if (RealItem.Effect > 0) { int wingOffset = RealItem.Effect == 1 ? 2 : 4; int genderOffset = MapObject.User.Gender == MirGender.Male ? 0 : 1; Libraries.Prguse2.DrawBlend(1200 + wingOffset + genderOffset, new Point(DisplayLocation.X, DisplayLocation.Y - 20), Color.White, true, 1F); } } if (WeaponCell.Item != null) { RealItem = Functions.GetRealItem(WeaponCell.Item.Info, Level, Class, GameScene.ItemInfoList); Libraries.StateItems.Draw(RealItem.Image, new Point(DisplayLocation.X, DisplayLocation.Y - 20), Color.White, true, 1F); } if (HelmetCell.Item != null) Libraries.StateItems.Draw(HelmetCell.Item.Info.Image, new Point(DisplayLocation.X, DisplayLocation.Y - 20), Color.White, true, 1F); else { int hair = 441 + Hair + (Class == MirClass.Assassin ? 20 : 0) + (Gender == MirGender.Male ? 0 : 40); int offSetX = Class == MirClass.Assassin ? (Gender == MirGender.Male ? 6 : 4) : 0; int offSetY = Class == MirClass.Assassin ? (Gender == MirGender.Male ? 25 : 18) : 0; Libraries.Prguse.Draw(hair, new Point(DisplayLocation.X + offSetX, DisplayLocation.Y + offSetY - 20), Color.White, true, 1F); } }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(241, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); GroupButton = new MirButton { HoverIndex = 432, Index = 431, Location = new Point(75, 357), Library = Libraries.Prguse, Parent = this, PressedIndex = 433, Sound = SoundList.ButtonA, }; GroupButton.Click += (o, e) => { if (GroupDialog.GroupList.Count >= Globals.MaxGroup) { GameScene.Scene.ChatDialog.ReceiveChat("Your group already has the maximum number of members.", ChatType.System); return; } if (GroupDialog.GroupList.Count > 0 && GroupDialog.GroupList[0] != MapObject.User.Name) { GameScene.Scene.ChatDialog.ReceiveChat("You are not the leader of your group.", ChatType.System); } Network.Enqueue(new C.AddMember { Name = Name }); return; }; FriendButton = new MirButton { HoverIndex = 435, Index = 434, Location = new Point(105, 357), Library = Libraries.Prguse, Parent = this, PressedIndex = 436, Sound = SoundList.ButtonA, }; FriendButton.Click += (o, e) => { Network.Enqueue(new C.AddFriend { Name = Name, Blocked = false }); }; MailButton = new MirButton { HoverIndex = 438, Index = 437, Location = new Point(135, 357), Library = Libraries.Prguse, Parent = this, PressedIndex = 439, Sound = SoundList.ButtonA, }; MailButton.Click += (o, e) => GameScene.Scene.MailComposeLetterDialog.ComposeMail(Name); TradeButton = new MirButton { HoverIndex = 524, Index = 523, Location = new Point(165, 357), Library = Libraries.Prguse, Parent = this, PressedIndex = 525, Sound = SoundList.ButtonA, }; TradeButton.Click += (o, e) => Network.Enqueue(new C.TradeRequest()); NameLabel = new MirLabel { DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(50, 12), Size = new Size(190, 20), NotControl = true }; NameLabel.Click += (o, e) => { GameScene.Scene.ChatDialog.ChatTextBox.SetFocus(); GameScene.Scene.ChatDialog.ChatTextBox.Text = string.Format("/{0} ", Name); GameScene.Scene.ChatDialog.ChatTextBox.Visible = true; GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionLength = 0; GameScene.Scene.ChatDialog.ChatTextBox.TextBox.SelectionStart = Name.Length + 2; }; LoverButton = new MirButton { Index = 604, Location = new Point(17, 17), Library = Libraries.Prguse, Parent = this, Sound = SoundList.None }; GuildLabel = new MirLabel { DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Parent = this, Location = new Point(50, 33), Size = new Size(190, 30), NotControl = true, }; ClassImage = new MirImageControl { Index = 100, Library = Libraries.Prguse, Location = new Point(15, 33), Parent = this, NotControl = true, }; WeaponCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Weapon, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(123, 7), }; ArmorCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Armour, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(163, 7), }; HelmetCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Helmet, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 7), }; TorchCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Torch, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 134), }; NecklaceCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Necklace, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 98), }; BraceletLCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.BraceletL, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(8, 170), }; BraceletRCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.BraceletR, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 170), }; RingLCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.RingL, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(8, 206), }; RingRCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.RingR, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 206), }; AmuletCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Amulet, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(8, 242), }; BootsCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Boots, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(48, 242), }; BeltCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Belt, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(88, 242), }; StoneCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Stone, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(128, 242), }; MountCell = new MirItemCell { ItemSlot = (int)EquipmentSlot.Mount, GridType = MirGridType.Inspect, Parent = CharacterPage, Location = new Point(203, 62), }; }
public StorageDialog() { Index = 586; Library = Libraries.Prguse; Location = new Point(0, 224); Sort = true; MirImageControl TitleLabel = new MirImageControl { Index = 0, Library = Libraries.Title, Location = new Point(18, 5), Parent = this }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(363, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); Grid = new MirItemCell[10 * 8]; for (int x = 0; x < 10; x++) { for (int y = 0; y < 8; y++) { Grid[10 * y + x] = new MirItemCell { ItemSlot = 10 * y + x, GridType = MirGridType.Storage, Library = Libraries.Items, Parent = this, Location = new Point(x * 36 + 9 + x, y * 32 + 60 + y), }; } } }
public NPCDropDialog() { Index = 392; Library = Libraries.Prguse; Location = new Point(264, 224); Sort = true; Click += NPCDropPanel_Click; HoldButton = new MirButton { HoverIndex = 294, Index = 293, Location = new Point(114, 36), Library = Libraries.Title, Parent = this, PressedIndex = 295, Sound = SoundList.ButtonA, }; HoldButton.Click += (o, e) => Hold = !Hold; ConfirmButton = new MirButton { HoverIndex = 291, Index = 290, Location = new Point(114, 62), Library = Libraries.Title, Parent = this, PressedIndex = 292, Sound = SoundList.ButtonA, }; ConfirmButton.Click += (o, e) => Confirm(); InfoLabel = new MirLabel { AutoSize = true, Location = new Point(30, 10), Parent = this, NotControl = true, }; ItemCell = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.DropPanel, Library = Libraries.Items, Parent = this, Location = new Point(38, 72), }; ItemCell.Click += (o, e) => ItemCell_Click(); BeforeDraw += NPCDropPanel_BeforeDraw; AfterDraw += NPCDropPanel_AfterDraw; }
public BeltDialog() { Index = 1932; Library = Libraries.Prguse; Movable = true; Sort = true; Visible = true; Location = new Point(230, Settings.ScreenHeight - 150); BeforeDraw += BeltPanel_BeforeDraw; RotateButton = new MirButton { HoverIndex = 1927, Index = 1926, Location = new Point(222, 3), Library = Libraries.Prguse, Parent = this, PressedIndex = 1928, Sound = SoundList.ButtonA, Hint = "Rotate" }; RotateButton.Click += (o, e) => Flip(); CloseButton = new MirButton { HoverIndex = 1924, Index = 1923, Location = new Point(222, 19), Library = Libraries.Prguse, Parent = this, PressedIndex = 1925, Sound = SoundList.ButtonA, Hint = "Close (Z)" }; CloseButton.Click += (o, e) => Hide(); Grid = new MirItemCell[6]; for (int x = 0; x < 6; x++) { Grid[x] = new MirItemCell { ItemSlot = 40 + x, Size = new Size(32, 32), GridType = MirGridType.Inventory, Library = Libraries.Items, Parent = this, Location = new Point(x * 35 + 12, 3), }; } }
private void ItemCell_Click() { if (OldCell != null) { OldCell.Locked = false; TargetItem = null; OldCell = null; } if (GameScene.SelectedCell != null && PType == PanelType.Disassemble) { if (GameScene.SelectedCell.Item.Info.Grade != ItemGrade.None && GameScene.SelectedCell.Item.Info.Type != ItemType.Awakening) { TargetItem = GameScene.SelectedCell.Item; OldCell = GameScene.SelectedCell; OldCell.Locked = true; GameScene.SelectedCell = null; return; } } if (GameScene.SelectedCell != null && PType == PanelType.Downgrade) { if (GameScene.SelectedCell.Item.Awake.getAwakeLevel() != 0) { TargetItem = GameScene.SelectedCell.Item; OldCell = GameScene.SelectedCell; OldCell.Locked = true; GameScene.SelectedCell = null; return; } } if (GameScene.SelectedCell != null && PType == PanelType.Reset) { if (GameScene.SelectedCell.Item.IsAdded) { TargetItem = GameScene.SelectedCell.Item; OldCell = GameScene.SelectedCell; OldCell.Locked = true; GameScene.SelectedCell = null; return; } } if (PType == PanelType.Disassemble || PType == PanelType.Downgrade || PType == PanelType.Reset) { GameScene.SelectedCell.Locked = false; GameScene.SelectedCell = null; return; } ////////////////////////////////////// if (GameScene.SelectedCell == null || GameScene.SelectedCell.GridType != MirGridType.Inventory || (PType != PanelType.Sell && PType != PanelType.Consign && GameScene.SelectedCell.Item != null && GameScene.SelectedCell.Item.Info.Durability == 0)) return; /* if (GameScene.SelectedCell.Item != null && (GameScene.SelectedCell.Item.Info.StackSize > 1 && GameScene.SelectedCell.Item.Count > 1)) { MirAmountBox amountBox = new MirAmountBox("Sell Amount:", GameScene.SelectedCell.Item.Image, GameScene.SelectedCell.Item.Count); amountBox.OKButton.Click += (o, a) => { TargetItem = GameScene.SelectedCell.Item.Clone(); TargetItem.Count = amountBox.Amount; OldCell = GameScene.SelectedCell; OldCell.Locked = true; GameScene.SelectedCell = null; if (Hold) Confirm(); }; amountBox.Show(); } else { TargetItem = GameScene.SelectedCell.Item; OldCell = GameScene.SelectedCell; OldCell.Locked = true; GameScene.SelectedCell = null; if (Hold) Confirm(); } */ TargetItem = GameScene.SelectedCell.Item; OldCell = GameScene.SelectedCell; OldCell.Locked = true; GameScene.SelectedCell = null; if (Hold) Confirm(); }
public GuildDialog() { Index = 180; Library = Libraries.Prguse; Movable = true; Sort = true; Location = new Point((800 - Size.Width) / 2, (600 - Size.Height) / 2); #region tab buttons NoticeButton = new MirButton // Notice { Library = Libraries.Title, Index = 88, HoverIndex = 87, PressedIndex = 89, Sound = SoundList.ButtonA, Parent = this, Location = new Point(210, 400) }; NoticeButton.Click += (o, e) => ChangePage(0); MembersButton = new MirButton // Members { Library = Libraries.Title, Index = 76, HoverIndex = 77, PressedIndex = 75, Sound = SoundList.ButtonA, Parent = this, Location = new Point(125, 400), }; MembersButton.Click += (o, e) => ChangePage(1); StatusButton = new MirButton // Guild Stats { Library = Libraries.Title, Index = 67, HoverIndex = 68, PressedIndex = 66, Sound = SoundList.ButtonA, Parent = this, Location = new Point(40, 400) }; StatusButton.Click += (o, e) => ChangePage(2); StorageButton = new MirButton // Storage { Library = Libraries.Title, Index = 79, HoverIndex = 80, PressedIndex = 78, Sound = SoundList.ButtonA, Parent = this, Location = new Point(295, 400), Visible = false }; StorageButton.Click += (o, e) => ChangePage(3); BuffsButton = new MirButton // Buffs { Library = Libraries.Title, Index = 70, HoverIndex = 71, PressedIndex = 69, Sound = SoundList.ButtonA, Parent = this, Location = new Point(465, 400), Visible = false, }; BuffsButton.Click += (o, e) => ChangePage(4); RankButton = new MirButton // Ranks { Library = Libraries.Title, Index = 73, HoverIndex = 74, PressedIndex = 72, Sound = SoundList.ButtonA, Parent = this, Location = new Point(380, 400), Visible = false, }; RankButton.Click += (o, e) => ChangePage(5); GuildName = new MirLabel { Location = new Point(302, 9), Parent = this, Size = new Size(144, 16), Font = new Font(Settings.FontName, 8F), Text = "", Visible = true, }; GuildName.BeforeDraw += (o, e) => { if (MapControl.User.GuildName != "") GuildName.Text = MapControl.User.GuildName; else GuildName.Text = "None"; }; #endregion CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(563, 6), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA }; CloseButton.Click += (o, e) => Hide(); #region "notice tab" NoticePage = new MirImageControl() { Parent = this, Size = new Size(567, 368), Location = new Point(13, 37), Visible = true }; Notice = new MirTextBox() { ForeColour = Color.White, Font = new Font(Settings.FontName, 8F), Enabled = false, Visible = true, Parent = NoticePage, Size = new Size(550, 325), Location = new Point(0, 0) }; Notice.MultiLine(); NoticeEditButton = new MirButton { Visible = false, Index = 85, HoverIndex = 86, PressedIndex = 84, Library = Libraries.Title, Sound = SoundList.ButtonA, Parent = NoticePage, Location = new Point(27, 337) }; NoticeEditButton.Click += (o, e) => EditNotice(); NoticeSaveButton = new MirButton { Visible = false, Index = 82, HoverIndex = 83, PressedIndex = 84, Library = Libraries.Title, Sound = SoundList.ButtonA, Parent = NoticePage, Location = new Point(27, 337) }; NoticeSaveButton.Click += (o, e) => EditNotice(); NoticeUpButton = new MirButton { HoverIndex = 312, Library = Libraries.Prguse, Location = new Point(551, 0), Size = new Size(16, 14), Parent = NoticePage, PressedIndex = 313, Sound = SoundList.ButtonA }; NoticeUpButton.Click += (o, e) => { if (NoticeScrollIndex == 0) return; if (NoticeScrollIndex >= 25) NoticeScrollIndex -= 24; NoticeScrollIndex--; UpdateNotice(); }; NoticeDownButton = new MirButton { HoverIndex = 314, Library = Libraries.Prguse, Location = new Point(551, 316), Size = new Size(16, 14), Parent = NoticePage, PressedIndex = 315, Sound = SoundList.ButtonA }; NoticeDownButton.Click += (o, e) => { if (NoticeScrollIndex == Notice.MultiText.Length - 1) return; if (NoticeScrollIndex < 25) NoticeScrollIndex = 24; NoticeScrollIndex++; UpdateNotice(); }; NoticePositionBar = new MirButton { Index = 955, Library = Libraries.Prguse, Location = new Point(551, 15), Parent = NoticePage, Movable = true, Sound = SoundList.None }; NoticePositionBar.OnMoving += NoticePositionBar_OnMoving; NoticePage.KeyDown += NoticePanel_KeyDown; NoticePage.MouseWheel += NoticePanel_MouseWheel; #endregion #region "members tab" MembersPage = new MirImageControl() { Parent = this, Size = new Size(567, 368), Location = new Point(13, 37), Visible = false }; MembersPage.BeforeDraw += (o, e) => RequestUpdateMembers(); MembersHeaderRank = new MirLabel { Parent = MembersPage, BackColour = Color.FromArgb(0x00, 0x00, 0x33), ForeColour = Color.White, Text = "Rank:", Location = new Point(10, 10), Size = new Size(180, 14), Font = new Font(Settings.FontName, 7F), Visible = true }; MembersHeaderName = new MirLabel { Parent = MembersPage, BackColour = Color.FromArgb(0x00, 0x00, 0x33), ForeColour = Color.White, Text = "Name:", Location = new Point(190, 10), Size = new Size(180, 14), Font = new Font(Settings.FontName, 7F), Visible = true }; MembersHeaderStatus = new MirLabel { Parent = MembersPage, BackColour = Color.FromArgb(0x00, 0x00, 0x33), ForeColour = Color.White, Text = "Status:", Location = new Point(370, 10), Size = new Size(170, 14), Font = new Font(Settings.FontName, 7F), Visible = true }; MembersRanks = new MirDropDownBox[MemberPageRows]; MembersName = new MirLabel[MemberPageRows]; MembersStatus = new MirLabel[MemberPageRows]; MembersDelete = new MirButton[MemberPageRows]; for (int i = MembersRanks.Length - 1; i >= 0; i--) { int index = i; MembersRanks[i] = new MirDropDownBox() { BackColour = i % 2 == 0 ? Color.FromArgb(0x0F, 0x0F, 0x42) : Color.FromArgb(0x00, 0x00, 0x66), ForeColour = Color.White, Parent = MembersPage, Size = new Size(180, 14), Location = new Point(10, 24 + (i * 15)), Visible = false, Enabled = false }; MembersRanks[index].ValueChanged += (o, e) => OnNewRank(index, MembersRanks[index]._WantedIndex); } for (int i = 0; i < MembersName.Length; i++) { MembersName[i] = new MirLabel() { BackColour = i % 2 == 0 ? Color.FromArgb(0x0F, 0x0F, 0x42) : Color.FromArgb(0x00, 0x00, 0x66), ForeColour = Color.White, Parent = MembersPage, Size = new Size(180, 14), Location = new Point(190, 24 + (i * 15)), Visible = false, Enabled = false, Font = new Font(Settings.FontName, 7F) }; } for (int i = 0; i < MembersStatus.Length; i++) { MembersStatus[i] = new MirLabel() { BackColour = i % 2 == 0 ? Color.FromArgb(0x0F, 0x0F, 0x42) : Color.FromArgb(0x00, 0x00, 0x66), ForeColour = Color.White, Parent = MembersPage, Size = new Size(170, 14), Location = new Point(370, 24 + (i * 15)), Visible = false, Enabled = false, Font = new Font(Settings.FontName, 7F) }; } for (int i = 0; i < MembersDelete.Length; i++) { int index = i; MembersDelete[i] = new MirButton() { Enabled = true, Visible = false, Location = new Point(525, 24 + (i * 15)), Library = Libraries.Prguse, Index = 917, Parent = MembersPage }; MembersDelete[index].Click += (o, e) => DeleteMember(index); } MembersAddMember = new MirButton { Parent = MembersPage, Enabled = true, Visible = false, Location = new Point(27, 337), Library = Libraries.Title, Index = 64, HoverIndex = 65, PressedIndex = 63 }; MembersAddMember.Click += (o, e) => AddMember(); MembersUpButton = new MirButton { HoverIndex = 312, Library = Libraries.Prguse, Location = new Point(551, 0), Size = new Size(16, 14), Parent = MembersPage, PressedIndex = 313, Sound = SoundList.ButtonA }; MembersUpButton.Click += (o, e) => { if (MemberScrollIndex == 0) return; MemberScrollIndex--; UpdateMembers(); UpdateMembersScrollPosition(); }; MembersDownButton = new MirButton { HoverIndex = 314, Library = Libraries.Prguse, Location = new Point(551, 316), Size = new Size(16, 14), Parent = MembersPage, PressedIndex = 315, Sound = SoundList.ButtonA }; MembersDownButton.Click += (o, e) => { if (MemberScrollIndex == MembersShowCount - MemberPageRows) return; MemberScrollIndex++; UpdateMembers(); UpdateMembersScrollPosition(); }; MembersPositionBar = new MirButton { Index = 955, Library = Libraries.Prguse, Location = new Point(551, 15), Parent = MembersPage, Movable = true, Sound = SoundList.None }; MembersPositionBar.OnMoving += MembersPositionBar_OnMoving; MembersShowOfflineButton = new MirButton { Visible = true, Index = 1346, Library = Libraries.Prguse, Sound = SoundList.ButtonA, Parent = MembersPage, Location = new Point(432, 340) }; MembersShowOfflineButton.Click += (o, e) => MembersShowOfflineSwitch(); MembersShowOfflineStatus = new MirImageControl { Visible = true, Index = 1347, Library = Libraries.Prguse, Parent = MembersPage, Location = new Point(432, 340) }; MembersShowOfflineStatus.Click += (o, e) => MembersShowOfflineSwitch(); MembersShowOffline = new MirLabel { Visible = true, Text = "Show Offline Members", Location = new Point(449, 340), Parent = MembersPage, Size = new Size(150, 12), Font = new Font(Settings.FontName, 7F), ForeColour = Color.White }; MembersPage.KeyDown += MembersPanel_KeyDown; MembersPage.MouseWheel += MembersPanel_MouseWheel; #endregion #region "status tab" StatusPage = new MirImageControl() { Parent = this, Size = new Size(567, 368), Location = new Point(13, 37), Visible = false }; StatusPage.BeforeDraw += (o, e) => { if (MapControl.User.GuildName == "") StatusData.Text = ""; else StatusData.Text = string.Format("{0}\n{1}\n{2}\n{3}", MapObject.User.GuildName, Level, MemberCount, MaxMembers == 0 ? "Unlimited" : MaxMembers.ToString()); }; StatusHeaders = new MirLabel() { Location = new Point(10, 25), Size = new Size(100, 300), NotControl = true, Text = "Guild Name:\nLevel:\nMembers:\nMaximum Members:\n", Visible = true, Parent = StatusPage }; StatusData = new MirLabel() { Location = new Point(120, 25), Size = new Size(100, 300), NotControl = true, Text = "", Visible = true, Parent = StatusPage }; StatusExpBar = new MirImageControl() { Index = 7, Library = Libraries.Prguse, Location = new Point(0, 0), DrawImage = false, NotControl = true, Parent = StatusPage, Size = new Size(550, 7) }; StatusExpBar.BeforeDraw += StatusExpBar_BeforeDraw; StatusExpLabel = new MirLabel() { DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Location = new Point(0, 0), NotControl = true, Parent = StatusPage, Size = new Size(550, 12) }; #endregion #region "storage tab" StoragePage = new MirImageControl() { Parent = this, Size = new Size(567, 368), Location = new Point(13, 37), Visible = false }; StoragePage.BeforeDraw += (o, e) => { StorageGoldText.Text = Gold > 0 ? string.Format("{0:###,###,###} Gold", Gold) : "0 Gold"; if (MyRankId == 0) StorageGoldRemove.Visible = true; else StorageGoldRemove.Visible = false; }; StorageGoldIcon = new MirButton() { Parent = StoragePage, Size = new Size(32, 17), Location = new Point(10, 9), Visible = true, Library = Libraries.Prguse, Index = 28, NotControl = true, }; StorageGoldText = new MirLabel() { Parent = StoragePage, Size = new Size(150, 15), Location = new Point(47, 10), Visible = true, Text = "0", NotControl = true, BackColour = Color.FromArgb(0x0F, 0x0F, 0x42), Border = true, BorderColour = Color.FromArgb(0x54, 0x4F, 0x36) }; StorageGoldAdd = new MirButton() { Parent = StoragePage, Library = Libraries.Prguse, Index = 918, Visible = true, Enabled = true, Location = new Point(202, 10) }; StorageGoldAdd.Click += (o, e) => StorageAddGold(); StorageGoldRemove = new MirButton() { Parent = StoragePage, Library = Libraries.Prguse, Index = 917, Visible = false, Enabled = true, Location = new Point(218, 10) }; StorageGoldRemove.Click += (o, e) => StorageRemoveGold(); for (int i = 0; i < 9; i++) new MirLabel() { Parent = StoragePage, BackColour = Color.FromArgb(0x54, 0x4F, 0x36), Location = new Point(15, (i * 32) + 41 + i), Size = new Size(518, 1), Text = " " }; for (int i = 0; i < 15; i++) new MirLabel() { Parent = StoragePage, BackColour = Color.FromArgb(0x54, 0x4F, 0x36), Location = new Point((i * 36) + 14 + i, 41), Size = new Size(1, 265), Text = " " }; StorageGrid = new MirItemCell[112]; for (int i = 0; i < StorageGrid.Length; i++) { StorageGrid[i] = new MirItemCell() { BorderColour = Color.Lime, ItemSlot = i, GridType = MirGridType.GuildStorage, Library = Libraries.Items, Parent = StoragePage, Location = new Point((i % 14) * 36 + 15 + (i % 14), (i / 14) * 32 + 42 + (i / 14)) }; } #endregion #region "buffs tab" BuffsPage = new MirImageControl() { Parent = this, Size = new Size(567, 368), Location = new Point(13, 37), Visible = false }; #endregion #region "Ranks tab" RankPage = new MirImageControl() { Parent = this, Size = new Size(567, 368), Location = new Point(13, 37), Visible = false }; RankPage.BeforeDraw += (o, e) => RequestUpdateMembers(); RanksSelectText = new MirLabel() { Text = "Select a rank:", Location = new Point(50, 10), Size = new Size(120, 20), ForeColour = Color.White, Parent = RankPage, NotControl = true }; RanksName = new MirTextBox() { Location = new Point(300, 10), Size = new Size(150, 20), MaxLength = 20, Parent = RankPage, Visible = true, Enabled = false, Text = "", BackColour = Color.FromArgb(0x0F, 0x0F, 0x42), Border = true, BorderColour = Color.FromArgb(0x54, 0x4F, 0x36) }; RanksName.BeforeDraw += (o, e) => RanksName_BeforeDraw(); RanksName.TextBox.KeyPress += RanksName_KeyPress; RanksSaveName = new MirButton() { Location = new Point(455, 8), Enabled = false, Visible = true, Parent = RankPage, Index = 90, HoverIndex = 91, PressedIndex = 92, Library = Libraries.Title, Sound = SoundList.ButtonA }; RanksSaveName.Click += (o, e) => { RanksChangeName(); }; String[] Options = { "Edit ranks", "Recruit member", "Kick member", "Store item", "Retrieve item", "Alter alliance", "Change notice", "Activate Buff" }; RanksOptionsButtons = new MirButton[8]; RanksOptionsStatus = new MirImageControl[8]; RanksOptionsTexts = new MirLabel[8]; for (int i = 0; i < RanksOptionsButtons.Length; i++) { RanksOptionsButtons[i] = new MirButton() { Visible = true, Enabled = false, Index = 1346, Library = Libraries.Prguse, Sound = SoundList.ButtonA, Parent = RankPage, Location = new Point(i % 2 == 0 ? 140 : 310, i % 2 == 0 ? 100 + (i * 20) : 100 + ((i - 1) * 20)) }; int index = i; RanksOptionsButtons[i].Click += (o, e) => SwitchRankOption(index); } for (int i = 0; i < RanksOptionsStatus.Length; i++) { RanksOptionsStatus[i] = new MirImageControl() { Visible = false, Index = 1347, Library = Libraries.Prguse, Parent = RankPage, NotControl = true, Location = new Point(i % 2 == 0 ? 140 : 310, i % 2 == 0 ? 100 + (i * 20) : 100 + ((i - 1) * 20)) }; int index = i; RanksOptionsStatus[i].Click += (o, e) => SwitchRankOption(index); } for (int i = 0; i < RanksOptionsTexts.Length; i++) { RanksOptionsTexts[i] = new MirLabel() { Visible = true, NotControl = true, Parent = RankPage, Location = new Point(17 + (i % 2 == 0 ? 140 : 310), i % 2 == 0 ? 100 + (i * 20) : 100 + ((i - 1) * 20)), AutoSize = true, Text = Options[i] }; } RanksSelectBox = new MirDropDownBox() { Parent = RankPage, Location = new Point(130, 11), Size = new Size(150, 20), ForeColour = Color.White, Visible = true, Enabled = true }; RanksSelectBox.ValueChanged += (o, e) => OnRankSelect(RanksSelectBox._WantedIndex); #endregion }
public NPCAwakeDialog() { Index = 710; Library = Libraries.Title; Location = new Point(50, 40); Sort = true; Movable = true; GoldLabel = new MirLabel { AutoSize = true, Location = new Point(135, 268), Parent = this, NotControl = true, }; NeedItemLabel1 = new MirLabel { AutoSize = true, Location = new Point(90, 192), Parent = this, NotControl = true, }; NeedItemLabel2 = new MirLabel { AutoSize = true, Location = new Point(90, 231), Parent = this, NotControl = true, }; UpgradeButton = new MirButton { HoverIndex = 713, Index = 712, Location = new Point(80, 375), Library = Libraries.Title, Parent = this, PressedIndex = 714, Sound = SoundList.ButtonA, }; UpgradeButton.Click += (o, e) => Awakening(); CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(211, 5), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); ItemCells[0] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(112, 77), ItemSlot = 0, }; //ItemCells[0].AfterDraw += (o, e) => ItemCell_AfterDraw(); //ItemCells[0].Click += (o, e) => ItemCell_Click(); ItemCells[1] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(50, 191), ItemSlot = 1, Enabled = false, }; ItemCells[2] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(50, 230), ItemSlot = 2, Enabled = false, }; ItemCells[3] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(42, 322), ItemSlot = 3, }; ItemCells[4] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(86, 322), ItemSlot = 4, }; ItemCells[5] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(138, 322), ItemSlot = 5, }; ItemCells[6] = new MirItemCell { BorderColour = Color.Lime, GridType = MirGridType.AwakenItem, Library = Libraries.Items, Parent = this, Location = new Point(182, 322), ItemSlot = 6, }; SelectAwakeType = new MirDropDownBox() { Parent = this, Location = new Point(58, 153), Size = new Size(130, 16), ForeColour = Color.White, Visible = true, Enabled = true, }; SelectAwakeType.ValueChanged += (o, e) => OnAwakeTypeSelect(SelectAwakeType._WantedIndex); }
public RefineDialog() { Index = 1002; Library = Libraries.Prguse; Location = new Point(0, 225); Sort = true; MirImageControl TitleLabel = new MirImageControl { Index = 18, Library = Libraries.Title, Location = new Point(28, 5), Parent = this }; Grid = new MirItemCell[4 * 4]; for (int x = 0; x < 4; x++) { for (int y = 0; y < 4; y++) { int idx = 4 * y + x; Grid[idx] = new MirItemCell { ItemSlot = idx, GridType = MirGridType.Refine, Library = Libraries.Items, Parent = this, Size = new Size(34, 32), Location = new Point(x * 34 + 12 + x, y * 32 + 37 + y), }; } } }
public TrustMerchantDialog() { Index = 670; Library = Libraries.Prguse; Sort = true; SearchTextBox = new MirTextBox { Location = new Point(19, 329), Parent = this, Size = new Size(104, 15), MaxLength = 20, CanLoseFocus = true }; SearchTextBox.TextBox.KeyPress += SearchTextBox_KeyPress; SearchTextBox.TextBox.KeyUp += SearchTextBox_KeyUp; SearchTextBox.TextBox.KeyDown += SearchTextBox_KeyDown; FindButton = new MirButton { HoverIndex = 481, Index = 480, Location = new Point(130, 325), Library = Libraries.Title, Parent = this, PressedIndex = 482, Sound = SoundList.ButtonA, }; FindButton.Click += (o, e) => { if (string.IsNullOrEmpty(SearchTextBox.Text)) return; if (CMain.Time < SearchTime) { GameScene.Scene.ChatDialog.ReceiveChat(string.Format("You can search again after {0} seconds.", Math.Ceiling((SearchTime - CMain.Time) / 1000D)), ChatType.System); return; } SearchTime = CMain.Time + Globals.SearchDelay; Network.Enqueue(new C.MarketSearch { Match = SearchTextBox.Text, }); }; RefreshButton = new MirButton { HoverIndex = 664, Index = 663, Location = new Point(190, 325), Library = Libraries.Prguse, Parent = this, PressedIndex = 665, Sound = SoundList.ButtonA, }; RefreshButton.Click += (o, e) => { if (CMain.Time < SearchTime) { GameScene.Scene.ChatDialog.ReceiveChat(string.Format("You can search again after {0} seconds.", Math.Ceiling((SearchTime - CMain.Time) / 1000D)), ChatType.System); return; } SearchTime = CMain.Time + Globals.SearchDelay; SearchTextBox.Text = string.Empty; Network.Enqueue(new C.MarketRefresh()); }; MailButton = new MirButton { HoverIndex = 667, Index = 666, Location = new Point(225, 325), Library = Libraries.Prguse, Parent = this, PressedIndex = 668, Sound = SoundList.ButtonA, Visible = false }; BuyButton = new MirButton { HoverIndex = 484, Index = 483, Location = new Point(400, 325), Library = Libraries.Title, Parent = this, PressedIndex = 485, Sound = SoundList.ButtonA, }; BuyButton.Click += (o, e) => { if (Selected == null || CMain.Time < MarketTime) return; if (UserMode) { if (Selected.Listing.Seller == "For Sale") { MirMessageBox box = new MirMessageBox(string.Format("{0} has not sold, Are you sure you want to get it back?", Selected.Listing.Item.Name), MirMessageBoxButtons.YesNo); box.YesButton.Click += (o1, e2) => { MarketTime = CMain.Time + 3000; Network.Enqueue(new C.MarketGetBack { AuctionID = Selected.Listing.AuctionID }); }; box.Show(); } else { MarketTime = CMain.Time + 3000; Network.Enqueue(new C.MarketGetBack { AuctionID = Selected.Listing.AuctionID }); } } else { MirMessageBox box = new MirMessageBox(string.Format("Are you sure you want to buy {0} for {1}?", Selected.Listing.Item.Name, Selected.Listing.Price), MirMessageBoxButtons.YesNo); box.YesButton.Click += (o1, e2) => { MarketTime = CMain.Time + 3000; Network.Enqueue(new C.MarketBuy { AuctionID = Selected.Listing.AuctionID }); }; box.Show(); } }; BackButton = new MirButton { Index = 398, Location = new Point(189, 298), Library = Libraries.Prguse, Parent = this, PressedIndex = 399, Sound = SoundList.ButtonA, }; BackButton.Click += (o, e) => { if (Page <= 0) return; Page--; UpdateInterface(); }; NextButton = new MirButton { Index = 396, Location = new Point(283, 298), Library = Libraries.Prguse, Parent = this, PressedIndex = 397, Sound = SoundList.ButtonA, }; NextButton.Click += (o, e) => { if (Page >= PageCount - 1) return; if (Page < (Listings.Count - 1) / 10) { Page++; UpdateInterface(); return; } Network.Enqueue(new C.MarketPage { Page = Page + 1 }); }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(462, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); PageLabel = new MirLabel { Location = new Point(207, 298), Size = new Size(70, 18), DrawFormat = TextFormatFlags.HorizontalCenter, Parent = this, NotControl = true, Text = "0/0", }; NameLabel = new MirLabel { AutoSize = true, ForeColour = Color.Yellow, Location = new Point(20, 240), Parent = this, NotControl = true, }; TotalPriceLabel = new MirLabel { AutoSize = true, Location = new Point(20, 256), Parent = this, NotControl = true, }; SplitPriceLabel = new MirLabel { AutoSize = true, Location = new Point(20, 272), Parent = this, NotControl = true, }; DateLabel = new MirLabel { AutoSize = true, Location = new Point(250, 245), Parent = this, NotControl = true, Text = "Start Date:" }; ExpireLabel = new MirLabel { AutoSize = true, Location = new Point(250, 265), Parent = this, NotControl = true, Text = "Expire Date:" }; ItemLabel = new MirLabel { Location = new Point(7, 32), Size = new Size(142, 22), DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Text = "Item", }; PriceLabel = new MirLabel { Location = new Point(148, 32), Size = new Size(180, 22), DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Text = "Price", }; SellerLabel = new MirLabel { Location = new Point(327, 32), Size = new Size(150, 22), DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, Parent = this, NotControl = true, Text = "Seller", }; for (int i = 0; i < Rows.Length; i++) { Rows[i] = new AuctionRow { Location = new Point(8, 54 + i * 18), Parent = this }; Rows[i].Click += (o, e) => { Selected = (AuctionRow)o; UpdateInterface(); }; } ItemCell = new MirItemCell { ItemSlot = 0, GridType = MirGridType.TrustMerchant, Library = Libraries.Items, Parent = this, Location = new Point(195, 248), }; }
public InventoryDialog() { Index = 196; Library = Libraries.Title; Movable = true; Sort = true; Visible = false; WeightBar = new MirImageControl { Index = 24, Library = Libraries.Prguse, Location = new Point(182, 217), Parent = this, DrawImage = false, NotControl = true, }; ItemButton = new MirButton { Index = 197, Library = Libraries.Title, Location = new Point(6, 7), Parent = this, Size = new Size(72, 23), Sound = SoundList.ButtonA, }; ItemButton.Click += Button_Click; ItemButton2 = new MirButton { Index = 738, Library = Libraries.Title, Location = new Point(78, 7), Parent = this, Size = new Size(72, 23), Sound = SoundList.ButtonA, }; ItemButton2.Click += Button_Click; QuestButton = new MirButton { Index = 739, Library = Libraries.Title, Location = new Point(148, 7), Parent = this, Size = new Size(72,23), Sound = SoundList.ButtonA, }; QuestButton.Click += Button_Click; AddButton = new MirButton { Index = 483, HoverIndex = 484, PressedIndex = 485, Library = Libraries.Title, Location = new Point(235, 5), Parent = this, Size = new Size(72, 23), Sound = SoundList.ButtonA, Visible = false, }; AddButton.Click += (o1, e) => { int openLevel = (GameScene.User.Inventory.Length - 46) / 4; int openGold = (1000000 + openLevel * 1000000); MirMessageBox messageBox = new MirMessageBox(string.Format("Are you sure you would like to unlock 4 extra slots for {0:###,###} gold ?\n" + "This will take your inventory space up to {1} slots in total.", openGold, GameScene.User.Inventory.Length+4), MirMessageBoxButtons.OKCancel); messageBox.OKButton.Click += (o, a) => { Network.Enqueue(new C.Chat { Message = "@ADDINVENTORY" }); }; messageBox.Show(); }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Location = new Point(289, 3), Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); GoldLabel = new MirLabel { Parent = this, Location = new Point(40, 212), Size = new Size(111, 14), Sound = SoundList.Gold, }; GoldLabel.Click += (o, e) => { if (GameScene.SelectedCell == null) GameScene.PickedUpGold = !GameScene.PickedUpGold && GameScene.Gold > 0; }; Grid = new MirItemCell[8 * 10]; for (int x = 0; x < 8; x++) { for (int y = 0; y < 10; y++) { int idx = 8 * y + x; Grid[idx] = new MirItemCell { ItemSlot = 6 + idx, GridType = MirGridType.Inventory, Library = Libraries.Items, Parent = this, Location = new Point(x * 36 + 9 + x, y % 5 * 32 + 37 + y % 5), }; if (idx >= 40) Grid[idx].Visible = false; } } QuestGrid = new MirItemCell[8 * 5]; for (int x = 0; x < 8; x++) { for (int y = 0; y < 5; y++) { QuestGrid[8 * y + x] = new MirItemCell { ItemSlot = 8 * y + x, GridType = MirGridType.QuestInventory, Library = Libraries.Items, Parent = this, Location = new Point(x * 36 + 9 + x, y * 32 + 37 + y), Visible = false }; } } WeightLabel = new MirLabel { Parent = this, Location = new Point(268, 212), Size = new Size(26, 14) }; WeightBar.BeforeDraw += WeightBar_BeforeDraw; for (int i = 0; i < LockBar.Length; i++) { LockBar[i] = new MirImageControl { Index = 307, Library = Libraries.Prguse2, Location = new Point(9 + i % 2 * 148, 37 + i / 2 * 33), Parent = this, DrawImage = true, NotControl = true, Visible = false, }; } }
protected override void Dispose(bool disposing) { if (disposing) { Scene = null; User = null; MoveTime = 0; AttackTime = 0; NextRunTime = 0; CanMove = false; CanRun = false; MapControl = null; MainDialog = null; ChatDialog = null; ChatControl = null; InventoryDialog = null; CharacterDialog = null; StorageDialog = null; BeltDialog = null; MiniMapDialog = null; InspectDialog = null; OptionDialog = null; MenuDialog = null; NPCDialog = null; QuestDetailDialog = null; QuestListDialog = null; QuestLogDialog = null; QuestTrackingDialog = null; GameShopDialog = null; MentorDialog = null; RelationshipDialog = null; CharacterDuraPanel = null; DuraStatusPanel = null; HoverItem = null; SelectedCell = null; PickedUpGold = false; UseItemTime = 0; PickUpTime = 0; InspectTime = 0; DisposeItemLabel(); AMode = 0; PMode = 0; Lights = 0; NPCTime = 0; NPCID = 0; DefaultNPCID = 0; for (int i = 0; i < OutputLines.Length; i++) if (OutputLines[i] != null && OutputLines[i].IsDisposed) OutputLines[i].Dispose(); OutputMessages.Clear(); OutputMessages = null; } base.Dispose(disposing); }
public BeltDialog() { Index = 1932; Library = Libraries.Prguse; Movable = true; Sort = true; Visible = true; Location = new Point(GameScene.Scene.MainDialog.Location.X + 230, Settings.ScreenHeight - 150); BeforeDraw += BeltPanel_BeforeDraw; for (int i = 0; i < Key.Length; i++) { Key[i] = new MirLabel { Parent = this, Size = new Size(26, 14), Location = new Point(8 + i * 35, 2), Text = (i + 1).ToString() }; } RotateButton = new MirButton { HoverIndex = 1927, Index = 1926, Location = new Point(222, 3), Library = Libraries.Prguse, Parent = this, PressedIndex = 1928, Sound = SoundList.ButtonA, Hint = "Rotate" }; RotateButton.Click += (o, e) => Flip(); CloseButton = new MirButton { HoverIndex = 1924, Index = 1923, Location = new Point(222, 19), Library = Libraries.Prguse, Parent = this, PressedIndex = 1925, Sound = SoundList.ButtonA, Hint = "Close (Z)" }; CloseButton.Click += (o, e) => Hide(); Grid = new MirItemCell[6]; for (int x = 0; x < 6; x++) { Grid[x] = new MirItemCell { ItemSlot = x, Size = new Size(32, 32), GridType = MirGridType.Inventory, Library = Libraries.Items, Parent = this, Location = new Point(x * 35 + 12, 3), }; } }
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 }
private void MoveItem() { if (SelectedCell == this) { SelectedCell = null; return; } UserItem I; if (SelectedCell != null) { if (SelectedCell.Item == null) { SelectedCell = null; return; } switch (GridType) { #region To Inventory case MirGridType.Inventory: switch (SelectedCell.GridType) { case MirGridType.Inventory: //From Inventory OutBound.MoveItem(GridType, SelectedCell.ItemSlot, ItemSlot); if (Item == null) { Item = SelectedCell.Item; SelectedCell.Item = null; SelectedCell = null; return; } I = Item; Item = SelectedCell.Item; SelectedCell.Item = I; return; case MirGridType.Equipment: // From Equipment if (!CanRemoveItem(SelectedCell.Item)) { SelectedCell = null; return; } OutBound.RemoveItem(GridType, SelectedCell.Item.UniqueID, ItemSlot); if (ItemArray[ItemSlot] == null) { ItemArray[ItemSlot] = SelectedCell.Item; SelectedCell.Item = null; SelectedCell = null; MapObject.User.RefreshLibraries(); MapObject.User.CalculateWeight(); return; } for (int X = 0; X < ItemArray.Length; X++) { if (ItemArray[X] == null) { ItemArray[X] = SelectedCell.Item; SelectedCell.Item = null; SelectedCell = null; MapObject.User.RefreshLibraries(); MapObject.User.CalculateWeight(); return; } } break; } break; #endregion #region To Equipment case MirGridType.Equipment: { if (CorrectSlot(SelectedCell.Item)) { if (CanWearItem(SelectedCell.Item)) { OutBound.EquipItem(SelectedCell.GridType, SelectedCell.Item.UniqueID, ItemSlot); I = Item; Item = SelectedCell.Item; SelectedCell.Item = I; } SelectedCell = null; MapObject.User.RefreshLibraries(); MapObject.User.CalculateWeight(); } return; } #endregion } return; } if (Item != null) { SelectedCell = this; } }