From 332effd18f805904d4bc1a23cbb52501621a31a4 Mon Sep 17 00:00:00 2001 From: asayre Date: Wed, 6 Dec 2006 03:18:44 +0000 Subject: [PATCH] Comments when banning --- Scripts/Gumps/BanDurationGump.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Scripts/Gumps/BanDurationGump.cs b/Scripts/Gumps/BanDurationGump.cs index 10d83b870..ae09b629a 100644 --- a/Scripts/Gumps/BanDurationGump.cs +++ b/Scripts/Gumps/BanDurationGump.cs @@ -39,11 +39,11 @@ namespace Server.Gumps { } - public BanDurationGump( ArrayList list ) : base( (640 - 170) / 2, (480 - 305) / 2 ) + public BanDurationGump( ArrayList list ) : base( (640 - 500) / 2, (480 - 305) / 2 ) { m_List = list; - int width = 170; + int width = 500; int height = 305; AddPage( 0 ); @@ -64,6 +64,9 @@ namespace Server.Gumps AddInput( 4, 1, "Hours" ); AddInput( 5, 2, "Minutes" ); AddInput( 6, 3, "Seconds" ); + + AddHtml( 170, 45, 240, 20, "Comments:", false, false ); + AddTextField( 170, 65, 315, height - 80, 10 ); } public void AddInput( int bid, int idx, string name ) @@ -87,6 +90,8 @@ namespace Server.Gumps TextRelay m = info.GetTextEntry( 2 ); TextRelay s = info.GetTextEntry( 3 ); + TextRelay c = info.GetTextEntry( 10 ); + TimeSpan duration; bool shouldSet; @@ -222,11 +227,15 @@ namespace Server.Gumps if ( shouldSet ) { + string comment = ( c != null && c.Text.Trim().Length > 0 ) ? c.Text.Trim(): "No Comment"; + + for ( int i = 0; i < m_List.Count; ++i ) { Account a = (Account)m_List[i]; a.SetBanTags( from, DateTime.Now, duration ); + a.Comments.Add( new AccountComment( from.RawName, String.Format( "Ban of {0} duration: {1}", (( duration == TimeSpan.MaxValue )? "infinite" : duration.ToString()), comment ) ) ); } if ( duration == TimeSpan.MaxValue )