示例#1
0
 public void ShowParticleElement(ScreenParticleFXCookie cookie)
 {
     if (this.canShowParticles)
     {
         this.SetParticleFXVisibility(cookie, true);
     }
 }
示例#2
0
 private void SetParticleFXVisibility(ScreenParticleFXCookie cookie, bool isVisible)
 {
     if (cookie.Element == null)
     {
         return;
     }
     cookie.Element.Visible = isVisible;
 }
示例#3
0
 public void HideParticleElement(ScreenParticleFXCookie cookie)
 {
     if (cookie == null)
     {
         return;
     }
     this.SetParticleFXVisibility(cookie, false);
 }
示例#4
0
 public void ScheduleParticleFX(ScreenParticleFXCookie cookie)
 {
     if (cookie == null)
     {
         Service.Logger.WarnFormat("Null cookie passed, cannot schedule particle fx", new object[0]);
         return;
     }
     if (string.IsNullOrEmpty(cookie.ElementName))
     {
         Service.Logger.ErrorFormat("ScreenParticleHandler.ScheduleParticleFX: particle fx elementName is null", new object[0]);
         return;
     }
     this.particleFxes.Add(cookie);
     cookie.DelayTimer = Service.ViewTimerManager.CreateViewTimer(cookie.Delay, false, new TimerDelegate(this.OnParticleTimerDone), cookie);
 }
示例#5
0
        private void OnParticleTimerDone(uint timerId, object cookie)
        {
            if (cookie == null || this.screen == null)
            {
                return;
            }
            ScreenParticleFXCookie screenParticleFXCookie = (ScreenParticleFXCookie)cookie;

            screenParticleFXCookie.Element = this.screen.GetOptionalElement <UXElement>(screenParticleFXCookie.ElementName);
            if (screenParticleFXCookie.Element == null)
            {
                Service.Logger.ErrorFormat("ScreenParticleHandler.OnParticleTimerDone: Could not find fx:{0} id in UI", new object[]
                {
                    screenParticleFXCookie.ElementName
                });
                return;
            }
            this.ShowParticleElement(screenParticleFXCookie);
        }