public PlayingTimer(double duration, DawnsMusicBox box) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0)) { m_Box = box; m_Until = DateTime.Now + TimeSpan.FromSeconds(duration); Priority = TimerPriority.TwoFiftyMS; }
public virtual void OnTarget(Mobile from, object obj) { if (Deleted) { return; } DawnsMusicBox mb = obj as DawnsMusicBox; if (mb == null) { from.SendMessage("That is not a Dawn's music box."); } else { if (mb.AddSong(m_Music)) { from.SendMessage("You have added this gear to the music box."); Delete(); } else { from.SendMessage("This gear is already present in this box."); } } }
public void StopBoxesInRange() { Map boxMap = this.Map; if (boxMap != Map.Internal) { Point3D boxLoc = this.Location; IPooledEnumerable itemsEable = boxMap.GetItemsInRange(boxLoc, MusicRange); foreach (Item i in itemsEable) { if (i is DawnsMusicBox && i != this) { DawnsMusicBox mb = (DawnsMusicBox)i; if (mb.IsPlaying) { mb.ToggleTimer(false); mb.PublicOverheadMessage(MessageType.Regular, 0x5D, true, "* The musix box stops *"); } } } itemsEable.Free(); } }
private static List <int> BuildList(DawnsMusicBox box, bool hasStopSongEntry) { List <int> list = new List <int>(); for (int i = 0; i < box.Tracks.Count; i++) { TrackInfo ti = TrackInfo.GetInfo(box.Tracks[i]); list.Add(ti.Label); } if (hasStopSongEntry) { list.Add(1075207); // Stop Song } return(list); }
public MusicGump(DawnsMusicBox box, List <int> songs, int page) : base(50, 50) { Closable = false; Disposable = true; Dragable = true; Resizable = false; m_Box = box; m_Songs = songs; m_Page = page; m_HasStopSongEntry = m_Box.IsPlaying; if (m_Songs == null) { m_Songs = BuildList(box, m_HasStopSongEntry); } Initialize(); }
public MusicGump(DawnsMusicBox box, List <int> songs, int page) : base(50, 50) { this.Closable = false; this.Disposable = true; this.Dragable = true; this.Resizable = false; this.m_Box = box; this.m_Songs = songs; this.m_Page = page; this.m_HasStopSongEntry = this.m_Box.IsPlaying; if (this.m_Songs == null) { this.m_Songs = BuildList(box, this.m_HasStopSongEntry); } this.Initialize(); }
private static List<int> BuildList( DawnsMusicBox box, bool hasStopSongEntry ) { List<int> list = new List<int>(); for( int i = 0; i < box.Tracks.Count; i++ ) { TrackInfo ti = TrackInfo.GetInfo( box.Tracks[i] ); list.Add( ti.Label ); } if( hasStopSongEntry ) list.Add( 1075207 ); // Stop Song return list; }
public MusicGump( DawnsMusicBox box, List<int> songs, int page ) : base( 50, 50 ) { Closable = false; Disposable = true; Dragable = true; Resizable = false; m_Box = box; m_Songs = songs; m_Page = page; m_HasStopSongEntry = m_Box.IsPlaying; if( m_Songs == null ) m_Songs = BuildList( box, m_HasStopSongEntry ); Initialize(); }
public MusicGump( DawnsMusicBox box ): this( box, null, 1 ) { }
public PlayingTimer( double duration, DawnsMusicBox box ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) ) { m_Box = box; m_Until = DateTime.Now + TimeSpan.FromSeconds( duration ); Priority = TimerPriority.TwoFiftyMS; }
public MusicGump(DawnsMusicBox box) : this(box, null, 1) { }
public MusicGump(DawnsMusicBox box, List<int> songs, int page) : base(50, 50) { this.Closable = false; this.Disposable = true; this.Dragable = true; this.Resizable = false; this.m_Box = box; this.m_Songs = songs; this.m_Page = page; this.m_HasStopSongEntry = this.m_Box.IsPlaying; if (this.m_Songs == null) this.m_Songs = BuildList(box, this.m_HasStopSongEntry); this.Initialize(); }
public PlayingTimer(double duration, DawnsMusicBox box) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0)) { m_Box = box; m_Until = DateTime.UtcNow + TimeSpan.FromSeconds(duration); }