Ejemplo n.º 1
0
            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;
            }
Ejemplo n.º 2
0
        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.");
                }
            }
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
            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);
            }
Ejemplo n.º 5
0
            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();
            }
Ejemplo n.º 6
0
            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();
            }
Ejemplo n.º 7
0
			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;
			}
Ejemplo n.º 8
0
			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();
	        }
Ejemplo n.º 9
0
			public MusicGump( DawnsMusicBox box ): this( box, null, 1 )
			{	
			}
Ejemplo n.º 10
0
			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;
            }
Ejemplo n.º 11
0
 public MusicGump(DawnsMusicBox box)
     : this(box, null, 1)
 {
 }
Ejemplo n.º 12
0
            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();
            }
Ejemplo n.º 13
0
 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);
 }