예제 #1
0
            public override void OnResponse(GameClient sender, RelayInfo info)
            {
                Mobile from = sender.Mobile;

                if (info.ButtonID == 0)
                {
                    return;
                }
                else if (info.ButtonID == 200)                   // Previous page
                {
                    m_Page--;
                    from.SendGump(new MusicGump(m_Box, m_Songs, m_Page));
                }
                else if (info.ButtonID == 300)                    // Next Page
                {
                    m_Page++;
                    from.SendGump(new MusicGump(m_Box, m_Songs, m_Page));
                }
                else if (m_HasStopSongEntry && info.ButtonID == m_Songs.Count)
                {
                    m_Box.TogglePlaying(false);
                }
                else
                {
                    TrackInfo ti = TrackInfo.GetInfo(m_Songs[info.ButtonID - 1]);
                    m_Box.ActualSong = ti.Name;
                    m_Box.TogglePlaying(true);
                }
            }
예제 #2
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            int commonSongs   = 0;
            int unCommonSongs = 0;
            int rareSongs     = 0;

            for (int i = 0; i < m_Tracks.Count; i++)
            {
                TrackInfo ti = TrackInfo.GetInfo(m_Tracks[i]);
                switch (ti.Rarity)
                {
                case TrackRarity.Common:        commonSongs++; break;

                case TrackRarity.UnCommon:      unCommonSongs++; break;

                case TrackRarity.Rare:          rareSongs++; break;
                }
            }

            if (commonSongs > 0)
            {
                list.Add(1075234, commonSongs.ToString());                   // ~1_NUMBER~ Common Tracks
            }
            if (unCommonSongs > 0)
            {
                list.Add(1075235, unCommonSongs.ToString());                   // ~1_NUMBER~ Uncommon Tracks
            }
            if (rareSongs > 0)
            {
                list.Add(1075236, rareSongs.ToString());                   // ~1_NUMBER~ Rare Tracks
            }
        }
예제 #3
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            TrackInfo ti = TrackInfo.GetInfo(m_Music);

            list.Add(ti.Label);
        }
예제 #4
0
        public override void AddNameProperty(ObjectPropertyList list)
        {
            TrackInfo ti = TrackInfo.GetInfo(m_Music);

            switch (ti.Rarity)
            {
            case TrackRarity.Common:        list.Add(1075204); break;                       // Gear for Dawn's Music Box (Common)

            case TrackRarity.UnCommon:      list.Add(1075205); break;                       // Gear for Dawn's Music Box (Uncommon)

            case TrackRarity.Rare:          list.Add(1075206); break;                       // Gear for Dawn's Music Box (Rare)
            }
        }
예제 #5
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);
            }
예제 #6
0
        public override LocalizedText GetNameProperty()
        {
            TrackInfo ti = TrackInfo.GetInfo(m_Music);

            switch (ti.Rarity)
            {
            default:
            case TrackRarity.Common:
                return(new LocalizedText(1075204));                          // Gear for Dawn's Music Box (Common)

            case TrackRarity.UnCommon:
                return(new LocalizedText(1075205));                          // Gear for Dawn's Music Box (Uncommon)

            case TrackRarity.Rare:
                return(new LocalizedText(1075206));                          // Gear for Dawn's Music Box (Rare)
            }
        }
예제 #7
0
        public void ToggleTimer(bool hasToStart)
        {
            if (IsPlaying && !hasToStart)
            {
                if (m_PlayingTimer != null && m_PlayingTimer.Running)                   // remove correctly the timer...
                {
                    m_PlayingTimer.Stop();
                }
                m_PlayingTimer = null;
            }
            else if (!IsPlaying && hasToStart)
            {
                TrackInfo ti = TrackInfo.GetInfo(m_ActualSong);

                m_PlayingTimer = new PlayingTimer((double)ti.Duration, this);                           // add a new timer
                m_PlayingTimer.Start();
            }
        }