public void ShowParticleElement(ScreenParticleFXCookie cookie) { if (this.canShowParticles) { this.SetParticleFXVisibility(cookie, true); } }
private void SetParticleFXVisibility(ScreenParticleFXCookie cookie, bool isVisible) { if (cookie.Element == null) { return; } cookie.Element.Visible = isVisible; }
public void HideParticleElement(ScreenParticleFXCookie cookie) { if (cookie == null) { return; } this.SetParticleFXVisibility(cookie, false); }
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); }
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); }