Exemple #1
0
 internal override void Bind(Event evt, TriggerLoop loop, pSprite sprite)
 {
     EventManager.OnPassing += delegate
     {
         Trigger(evt, loop, sprite, true);
     };
 }
Exemple #2
0
        protected void Trigger(Event evt, TriggerLoop loop, pSprite sprite, bool alwaysClearLoops)
        {
            if (alwaysClearLoops)
            {
                evt.RemoveAllLoops(TriggerGroup);
            }

            if (loop.TriggerEndTime != 0 &&
                (AudioEngine.Time < loop.TriggerStartTime || AudioEngine.Time > loop.TriggerEndTime))
            {
                return;
            }

            if (!alwaysClearLoops)
            {
                if (HasSpecificTriggerGroup)
                {
                    evt.RemoveAllLoops(TriggerGroup);
                }
                else
                {
                    evt.RemoveLoop(loop);
                }
            }

            loop.StartTime = AudioEngine.Time;
            sprite.MakeLoopStatic(loop);
        }
Exemple #3
0
        internal override void Bind(Event evt, TriggerLoop loop, pSprite sprite)
        {
            EventManager.OnHitSound += delegate(HitSoundInfo hitSoundInfo)
            {
                if (SampleSet != SampleSet.All && hitSoundInfo.SampleSet != SampleSet)
                {
                    return;
                }

                if (SampleSetAdditions != SampleSet.All &&
                    !(hitSoundInfo.SampleSetAdditions == SampleSetAdditions ||
                      hitSoundInfo.SampleSetAdditions == SampleSet.None && hitSoundInfo.SampleSet == SampleSetAdditions))
                {
                    return;
                }

                if (SoundType != HitObjectSoundType.None && !hitSoundInfo.SoundType.IsType(SoundType))
                {
                    return;
                }

                if (CheckCustomSampleSet && hitSoundInfo.CustomSampleSet != CustomSampleSet)
                {
                    return;
                }

                Trigger(evt, loop, sprite, false);
            };
        }
Exemple #4
0
 internal override void Bind(Event evt, TriggerLoop loop, pSprite sprite)
 {
     EventManager.OnHitObjectHit += delegate(HitObject h)
     {
         //only trigger if the actual value of this hit is positive (wasn't a miss or worse).
         if (h.scoreValue > 0)
         {
             Trigger(evt, loop, sprite, false);
         }
     };
 }
Exemple #5
0
        internal void RemoveLoop(TriggerLoop loop)
        {
            List <Transformation> last = loop.GetLastTransformations();

            //remove any transformations from the previous trigger first...
            if (last != null)
            {
                foreach (Transformation t in last)
                {
                    Sprite.Transformations.Remove(t);
                }
            }
        }
Exemple #6
0
        internal void BindEvent(TriggerLoop loop)
        {
            EventTrigger eventTrigger = loop.Trigger;

            List <TriggerLoop> list;

            if (!EventLoopTriggers.TryGetValue(eventTrigger.TriggerGroup, out list))
            {
                list = new List <TriggerLoop>();
                EventLoopTriggers.Add(eventTrigger.TriggerGroup, list);
            }

            list.Add(loop);

            //Trigger loops are a special case where the spriteManager isn't smart enough to know
            //where to insert them (they might trigger earlier than any existing transformations)
            Sprite.AlwaysDraw = true;
            Sprite.Alpha      = 0;

            eventTrigger.Bind(this, loop, Sprite);
        }
Exemple #7
0
 internal abstract void Bind(Event evt, TriggerLoop loop, pSprite sprite);