Comments when banning
This commit is contained in:
parent
ab5659d0e5
commit
332effd18f
1 changed files with 11 additions and 2 deletions
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue