public GuideGump( BaseGuide crier, string incpath ) : base( 50, 50 ) { m_Crier = crier; path = incpath; AddPage( 0 ); AddImageTiled( 0, 0, 410, 144, 0x52 ); AddAlphaRegion( 1, 1, 408, 142 ); AddLabel( 160, 12, 2100, "Guide Controls" ); string nowalk = Convert.ToString( m_Crier.NoWalk ); AddButton( 10, 34, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddLabel( 50, 34, 2100, "Frozen = "+ nowalk ); string active = Convert.ToString( m_Crier.Active ); AddButton( 10, 56, 4005, 4007, 2, GumpButtonType.Reply, 0 ); AddLabel( 50, 56, 2100, "Active = "+ active ); string random = Convert.ToString( m_Crier.Random ); AddButton( 200, 34, 4005, 4007, 3, GumpButtonType.Reply, 0 ); AddLabel( 240, 34, 2100, "Random = "+ random ); string delay = Convert.ToString( m_Crier.Delay ); AddButton( 200, 56, 4005, 4007, 4, GumpButtonType.Reply, 0 ); AddImageTiled( 240, 56, 70, 20, 0xBBC ); AddImageTiled( 241, 57, 68, 18, 0x2426 ); AddTextEntry( 241, 57, 68, 18, 0x480, 0, delay ); AddLabel( 315, 56, 2100, "Delay" ); AddButton( 10, 78, 4005, 4007, 5, GumpButtonType.Reply, 0 ); AddLabel( 50, 78, 2100, "Edit News" ); }
public static string SpamMessage( BaseGuide crier ) { ArrayList m_Lines = new ArrayList(); if ( File.Exists( path ) ) { using ( StreamReader ip = new StreamReader( path ) ) { string line; while ( (line = ip.ReadLine()) != null ) { if ( line.Length > 0 ) m_Lines.Add( line ); } } } string message; if ( m_Lines.Count == 0 ) { message = ""; } else if ( (crier.Active && crier.Random) ) { int i = Utility.Random( m_Lines.Count ); message = ""+ m_Lines[i]; } else { try { message = ""+ m_Lines[crier.Count++]; if ( crier.Count == m_Lines.Count ) crier.Count = 0; } catch { crier.Count = 0; message = ""+ m_Lines[crier.Count++]; } } return message; }
public SpamTimer( BaseGuide crier, TimeSpan m_Delay ) : base( TimeSpan.Zero, m_Delay ) { m_Crier = crier as BaseGuide; }
public EditGuideGump( BaseGuide crier, string incpath ) : base( 10, 10 ) { m_Crier = crier; path = incpath; AddPage( 0 ); AddImageTiled( 0, 0, 620, 460, 0x52 ); AddAlphaRegion( 1, 1, 618, 458 ); AddLabel( 250, 12, 2100, "Edit Guide News" ); AddLabel( 10, 34, 2100, "News Entries" ); ArrayList m_Lines = GetFile(); int row = 1; for ( int i = 0; i < 15; i++ ) { string line = m_Lines[i] as string; AddImageTiled( 10, 34 + (row * 22), 598, 20, 0xBBC ); AddImageTiled( 11, 34 + (row * 22) + 1, 596, 18, 0x2426 ); AddTextEntry( 11, 34 + (row++ * 22) + 1, 596, 18, 0x480, i, line ); } AddLabel( 500, 408, 2100, "Update File" ); AddButton( 576, 408, 4005, 4007, 1, GumpButtonType.Reply, 0 ); }