public RateHandlingGump(Mobile sender, Mobile handler, PageEntry entry) : base(0, 0) { _sender = sender; _handler = handler; _entry = entry; Closable = false; AddPage(0); AddBackground(20, 20, 400, 345, 9250); //AddLabel(120, 35, 0, "The Genesis Roleplaying Shard"); AddLabel(105, 55, 0, "Staff Reputation and Voting System"); AddLabel(40, 125, 0, "Please rate your experience"); AddLabelCropped(40, 145, 195, 20, 0, String.Format("with {0} today:", _handler.RawName)); int x = 240, y = 100; for (int i = 0; i < 5; i++, y += 20) { AddRadio(x, y, 208, 209, false, i + 1); AddLabel(x + 25, y, 1152, GetLabel(i)); } AddLabel(35, 198, 0, "Comments or Notes:"); AddBackground(32, 215, 375, 110, 9200); AddTextEntry(35, 220, 368, 100, 0, 0, ""); AddButton(375, 328, 4011, 4013, 0, GumpButtonType.Reply, 0); AddLabel(340, 330, 0, "Done"); }
public static void SendTo( Mobile to, Mobile sender, Mobile handler, bool staff, PageEntry entry, bool resendEntryGump ) { to.SendGump( new ChatGumpDisplay( sender, handler, staff, entry ) ); if( resendEntryGump ) to.SendGump( new ChatGumpEntry( sender, handler, entry ) ); }
public ChatGumpDisplay( Mobile sender, Mobile handler, bool staff, PageEntry entry ) : base(0, 0) { Closable = true; _sender = sender; _handler = handler; _entry = entry; AddPage( 1 ); AddBackground( 10, 10, 360, 245, 9250 ); AddLabelCropped( 25, 20, 320, 25, 1152, String.Format( "Page Assistance Chat - {0} {1} : {2}", FormatAccessLevel( handler ), handler.RawName, sender.RawName ) ); AddHtml( 25, 40, 330, 200, LoadFile( GetFileName( sender, handler ) ), false, true ); if( staff ) AddButton( 10, 242, 3, 4, 1, GumpButtonType.Reply, 0 ); }
public static void OnHandlerChanged( Mobile old, Mobile value, PageEntry entry ) { if( old != null && _handlerDictionary.ContainsKey( old ) ) _handlerDictionary.Remove( old ); if( value != null ) { if( IsHandling( value ) ) { value.SendMessage( "You cannot handle more than one page at a time." ); return; } else _handlerDictionary.Add( value, entry ); } entry.WriteLine( "### ---" ); entry.WriteLine( String.Format( "Page handler changed from {0} to {1}.", old == null ? "(-null-)" : old.RawName, value == null ? "(-null-)" : value.RawName ) ); entry.WriteLine( "---###" ); entry.WriteLine(); }
public PageEntryGump( Mobile m, PageEntry entry ) : base( 0, 0 ) { _mobile = m; _entry = entry; int buttons = 0; int bottom = 366; AddPage( 0 ); AddImageTiled( 10, 10, 410, 456, 0xA40 ); AddAlphaRegion( 11, 11, 408, 454 ); AddPage( 1 ); AddLabel( 28, 28, 2100, "Sent:" ); AddLabelCropped( 138, 28, 264, 20, 2100, entry.TimeSent.ToString() ); AddLabel( 28, 48, 2100, "Sender:" ); AddLabelCropped( 138, 48, 264, 20, 2100, String.Format( "{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map ) ); AddButton( 28, bottom - (buttons * 22), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0 ); AddImageTiled( 62, bottom - (buttons * 22) + 1, 340, 80, 0xA40 ); AddImageTiled( 63, bottom - (buttons * 22) + 2, 338, 78, 0xBBC ); AddTextEntry( 65, bottom - (buttons++ * 22) + 2, 336, 78, 0x480, 0, "" ); if( entry.Sender != m ) { AddButton( 28, bottom - (buttons * 22), 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 ); AddLabel( 62, bottom - (buttons++ * 22), 2100, "Go to Sender" ); } AddLabel( 28, 68, 2100, "Handler:" ); if( entry.Handler == null ) { AddLabelCropped( 138, 68, 264, 20, 2100, "Unhandled" ); AddButton( 28, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0 ); AddLabel( 62, bottom - (buttons++ * 22), 2100, "Delete Page" ); AddButton( 28, bottom - (buttons * 22), 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0 ); AddLabel( 62, bottom - (buttons++ * 22), 2100, "Handle Page" ); } else { try { AddLabelCropped( 138, 68, 264, 20, m_AccessLevelHues[(int)entry.Handler.AccessLevel], entry.Handler.RawName ); } catch( Exception e ) { Server.Utilities.ExceptionManager.LogException( "HelpEngine.cs", e ); } if( entry.Handler != m ) { AddButton( 28, bottom - (buttons * 22), 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 ); AddLabel( 62, bottom - (buttons++ * 22), 2100, "Go to Handler" ); } else { AddButton( 28, bottom - (buttons * 22), 0xFA2, 0xFA4, 6, GumpButtonType.Reply, 0 ); AddLabel( 62, bottom - (buttons++ * 22), 2100, "Abandon Page" ); AddButton( 28, bottom - (buttons * 22), 0xFB7, 0xFB9, 7, GumpButtonType.Reply, 0 ); AddLabel( 62, bottom - (buttons++ * 22), 2100, "Page Handled" ); } } AddLabel( 28, 88, 2100, "Page Location:" ); AddLabelCropped( 138, 88, 264, 20, 2100, String.Format( "{0} [{1}]", entry.OriginLocation, entry.OriginMap ) ); AddButton( 28, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0 ); AddLabel( 62, bottom - (buttons++ * 22), 2100, "Go to Page Location" ); if( entry.SpeechLog != null ) { AddButton( 28, bottom - (buttons * 22), 0xFA5, 0xFA7, 9, GumpButtonType.Reply, 0 ); AddLabel( 62, bottom - (buttons++ * 22), 2100, "View Speech Log" ); } AddLabel( 28, 108, 2100, "Page Type:" ); AddLabelCropped( 138, 108, 264, 20, 2100, PageQueue.GetPageTypeName( entry.Type ) ); AddLabel( 28, 128, 2100, "Message:" ); AddHtml( 138, 128, 250, 100, entry.Message, true, true ); }
public static void Remove( PageEntry entry ) { if( entry == null ) return; _list.Remove( entry ); if( entry.Sender != null ) _senderDictionary.Remove( entry.Sender ); if( entry.Handler != null ) _handlerDictionary.Remove( entry.Handler ); if( _list.Count == 0 ) { PageAlertGump.CloseAll(); } }
public static int IndexOf( PageEntry entry ) { return _list.IndexOf( entry ); }
public static void AddNewPage( PageEntry entry ) { _list.Add( entry ); _senderDictionary.Add( entry.Sender, entry ); PageAlertGump.SendToStaff(); }
public static void SendTo( Mobile to, Mobile sender, Mobile handler, bool staff, PageEntry entry ) { SendTo( to, sender, handler, staff, entry, true ); }
public ChatGumpEntry( Mobile sender, Mobile handler, PageEntry entry ) : base(0, 0) { Closable = true; _sender = sender; _handler = handler; _entry = entry; AddPage( 1 ); AddBackground( 10, 260, 360, 200, 5170 ); AddLabel( 30, 262, 0, "Message:" ); AddTextEntry( 35, 285, 310, 140, 0, 100, "" ); AddLabel( 296, 435, 0, "Send" ); AddButton( 335, 436, 4033, 4033, 1, GumpButtonType.Reply, 0 ); }
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 PageEntryGump(Mobile m, PageEntry entry) : base(0, 0) { _mobile = m; _entry = entry; int buttons = 0; int bottom = 366; AddPage(0); AddImageTiled(10, 10, 410, 456, 0xA40); AddAlphaRegion(11, 11, 408, 454); AddPage(1); AddLabel(28, 28, 2100, "Sent:"); AddLabelCropped(138, 28, 264, 20, 2100, entry.TimeSent.ToString()); AddLabel(28, 48, 2100, "Sender:"); AddLabelCropped(138, 48, 264, 20, 2100, String.Format("{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map)); AddButton(28, bottom - (buttons * 22), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0); AddImageTiled(62, bottom - (buttons * 22) + 1, 340, 80, 0xA40); AddImageTiled(63, bottom - (buttons * 22) + 2, 338, 78, 0xBBC); AddTextEntry(65, bottom - (buttons++ *22) + 2, 336, 78, 0x480, 0, ""); if (entry.Sender != m) { AddButton(28, bottom - (buttons * 22), 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0); AddLabel(62, bottom - (buttons++ *22), 2100, "Go to Sender"); } AddLabel(28, 68, 2100, "Handler:"); if (entry.Handler == null) { AddLabelCropped(138, 68, 264, 20, 2100, "Unhandled"); AddButton(28, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0); AddLabel(62, bottom - (buttons++ *22), 2100, "Delete Page"); AddButton(28, bottom - (buttons * 22), 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0); AddLabel(62, bottom - (buttons++ *22), 2100, "Handle Page"); } else { try { AddLabelCropped(138, 68, 264, 20, m_AccessLevelHues[(int)entry.Handler.AccessLevel], entry.Handler.RawName); } catch (Exception e) { Server.Utilities.ExceptionManager.LogException("HelpEngine.cs", e); } if (entry.Handler != m) { AddButton(28, bottom - (buttons * 22), 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0); AddLabel(62, bottom - (buttons++ *22), 2100, "Go to Handler"); } else { AddButton(28, bottom - (buttons * 22), 0xFA2, 0xFA4, 6, GumpButtonType.Reply, 0); AddLabel(62, bottom - (buttons++ *22), 2100, "Abandon Page"); AddButton(28, bottom - (buttons * 22), 0xFB7, 0xFB9, 7, GumpButtonType.Reply, 0); AddLabel(62, bottom - (buttons++ *22), 2100, "Page Handled"); } } AddLabel(28, 88, 2100, "Page Location:"); AddLabelCropped(138, 88, 264, 20, 2100, String.Format("{0} [{1}]", entry.OriginLocation, entry.OriginMap)); AddButton(28, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0); AddLabel(62, bottom - (buttons++ *22), 2100, "Go to Page Location"); if (entry.SpeechLog != null) { AddButton(28, bottom - (buttons * 22), 0xFA5, 0xFA7, 9, GumpButtonType.Reply, 0); AddLabel(62, bottom - (buttons++ *22), 2100, "View Speech Log"); } AddLabel(28, 108, 2100, "Page Type:"); AddLabelCropped(138, 108, 264, 20, 2100, PageQueue.GetPageTypeName(entry.Type)); AddLabel(28, 128, 2100, "Message:"); AddHtml(138, 128, 250, 100, entry.Message, true, true); }
public static void SendTo(Mobile to, Mobile sender, Mobile handler, bool staff, PageEntry entry, bool resendEntryGump) { to.SendGump(new ChatGumpDisplay(sender, handler, staff, entry)); if (resendEntryGump) { to.SendGump(new ChatGumpEntry(sender, handler, entry)); } }
public static void SendTo(Mobile to, Mobile sender, Mobile handler, bool staff, PageEntry entry) { SendTo(to, sender, handler, staff, entry, true); }