public override void OnResponse(Server.Network.NetState state, int index) { if (index == 0) { OnCancel(state); } else if (index == 1) { PageEntry entry = PageQueue.GetEntry(_from); if (entry != null) { if (entry.Handler != null) { _from.SendMessage("Your page is currently being handled by a staff member, and cannot be cancelled at this time."); } else { _from.SendLocalizedMessage(1005307, "", 0x35); //Removed help request. PageQueue.Remove(entry); } } else { OnCancel(state); } } }
public PageQueueGump() : base(0, 0) { AddPage(0); AddImageTiled(10, 10, 410, 448, 0xA40); AddAlphaRegion(11, 11, 408, 446); AddLabel(190, 22, 2100, "Page Queue"); List <PageEntry> list = PageQueue.List; for (int i = 0; i < list.Count;) { if (list[i].Sender == null || list[i].Sender.Deleted) { PageQueue.Remove(list[i]); } else { i++; } } _list = list.ToArray(); if (_list.Length > 0) { AddPage(1); for (int i = 0; i < _list.Length; ++i) { PageEntry entry = _list[i]; if (i >= 5 && (i % 5) == 0) { AddLabel(308, 22, 2100, "Next Page"); AddLabel(58, 22, 2100, "Previous Page"); AddButton(378, 22, 0xFA5, 0xFA7, 0, GumpButtonType.Page, (i / 5) + 1); AddButton(22, 22, 0xFAE, 0xFB0, 0, GumpButtonType.Page, (i / 5)); AddPage((i / 5) + 1); } string typeString = PageQueue.GetPageTypeName(entry.Type); string html = String.Format("[{0}] {1} <basefont color=#{2:X6}>[<u>{3}</u>]</basefont>", typeString, entry.Message, entry.Handler == null ? 0xFF0000 : 0xFF, entry.Handler == null ? "Unhandled" : "Handling"); AddHtml(22, 54 + ((i % 5) * 80), 350, 70, html, true, true); AddButton(380, 54 + ((i % 5) * 80) + 24, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0); } } else { AddLabel(22, 54, 2100, "The page queue is empty."); } }
public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { if (info.ButtonID == 1) { ChatGump.Close(_sender); ChatGump.Close(_handler); if (File.Exists(GetFileName(_sender, _handler))) { File.Delete(GetFileName(_sender, _handler)); } _sender.SendMessage("{0} has determined that your problem is resolved, and has removed your page from the queue. If this is not the case, please file a separate page with more information.", _handler.RawName); _handler.SendMessage("You have closed the page, and deleted it from the queue."); _sender.SendGump(new RateHandlingGump(_sender, _handler, _entry)); PageQueue.Remove(_entry); _entry = null; } }
public override void OnResponse(NetState state, RelayInfo info) { Mobile m = state.Mobile; switch (info.ButtonID) { default: case 0: { if (_entry.Handler != state.Mobile) { PageQueueGump g = new PageQueueGump(); g.SendTo(state); } break; } case 1: //go to sender { if (_entry.Sender.Deleted) { m.SendMessage("That character no longer exists."); } else if (_entry.Sender.Map == null || _entry.Sender.Map == Map.Internal) { m.SendMessage("That character is not in this world."); } else { m.MoveToWorld(_entry.Sender.Location, _entry.Sender.Map); m.SendMessage("You have been teleported to that page's sender."); Resend(state); } break; } case 2: //go to handler { Mobile h = _entry.Handler; if (h != null) { if (h.Deleted) { m.SendMessage("That character no longer exists."); } else if (h.Map == null || h.Map == Map.Internal) { m.SendMessage("That character is not in this world."); } else { m.MoveToWorld(h.Location, h.Map); m.SendMessage("You have been teleported to that page's handler."); Resend(state); } } break; } case 3: //go to page location { if (_entry.OriginMap == null || _entry.OriginMap == Map.Internal) { m.SendMessage("That location is not in this world."); } else { m.MoveToWorld(_entry.OriginLocation, _entry.OriginMap); m.SendMessage("You have been teleported to the original page location."); Resend(state); } break; } case 4: //handle page { if (_entry.Handler == null) { _entry.Handler = m; m.SendMessage("You are now handling this page."); ChatGump.SendTo(_entry.Sender, _entry.Sender, m, false, _entry); ChatGump.SendTo(m, _entry.Sender, m, true, _entry); _entry.WriteLine("##############################"); _entry.WriteLine(String.Format("--------Page Type: {0}--------", PageQueue.GetPageTypeName(_entry.Type))); _entry.WriteLine(String.Format("--- Description: {0} ---", _entry.Message)); _entry.WriteLine("##############################"); _entry.WriteLine(); } else { m.SendMessage("{0} is already handling this page.", _entry.Handler.RawName); } break; } case 5: //delete page { if (_entry.Handler == null) { PageQueue.Remove(_entry); m.SendMessage("You delete the page."); PageQueueGump g = new PageQueueGump(); g.SendTo(state); } else { m.SendMessage("Someone is handling that page, and it cannot be deleted."); Resend(state); } break; } case 6: //abandon page { if (_entry.Handler == state.Mobile) { m.SendMessage("You have abandoned the page."); ChatGump.Close(_entry.Sender); ChatGump.Close(m); _entry.Handler = null; } else { m.SendMessage("You are not handling that page."); } Resend(state); break; } case 7: //page handled { if (_entry.Handler == state.Mobile) { PageQueue.Remove(_entry); if (_entry.Sender.HasGump(typeof(ChatGump))) { m.SendMessage(0x35, String.Format("{0} still has the chat gump open.", _entry.Sender.RawName)); Resend(state); } _entry.Handler = null; m.SendMessage("You mark the page as handled, and remove it from the queue."); PageQueueGump g = new PageQueueGump(); g.SendTo(state); } else { m.SendMessage("You are not handling that page."); Resend(state); } break; } case 8: //send message { TextRelay text = info.GetTextEntry(0); if (text != null) { _entry.Sender.SendGump(new MessageSentGump(_entry.Sender, m, text.Text)); } Resend(state); break; } case 9: //view speech log { if (_entry.SpeechLog != null) { m.SendGump(new Server.Engines.Help.SpeechLogGump(_entry.Sender, _entry.SpeechLog)); } Resend(state); break; } } }