Beispiel #1
0
        protected virtual void OnAnimationComplete(uint id, object cookie)
        {
            PersistentScreenState animatingState = this.AnimatingState;

            if (animatingState != PersistentScreenState.Closing)
            {
                if (animatingState == PersistentScreenState.Opening)
                {
                    this.AnimatingState = PersistentScreenState.Open;
                    this.openCloseAnim.Play();
                    this.animState.time = this.animState.length;
                    this.openCloseAnim.Sample();
                    this.openCloseAnim.Stop();
                    this.OnOpen();
                }
            }
            else
            {
                this.AnimatingState = PersistentScreenState.Closed;
                this.openCloseAnim.Play();
                this.animState.time = 0f;
                this.openCloseAnim.Sample();
                this.openCloseAnim.Stop();
                this.OnClose();
                if (this.shouldCloseOnAnimComplete)
                {
                    object modalResult = this.closeModalResult;
                    this.Close(modalResult);
                }
            }
            this.animationTimer = 0u;
        }
Beispiel #2
0
 protected PersistentAnimatedScreen(string assetName) : base(assetName)
 {
     this.animationTimer            = 0u;
     this.AnimatingState            = PersistentScreenState.Closed;
     this.shouldCloseOnAnimComplete = false;
     this.closeModalResult          = null;
 }
Beispiel #3
0
 public void InstantClose(bool shouldCloseOnAnimComplete, object modalResult)
 {
     this.ClearDefaultBackDelegate();
     this.shouldCloseOnAnimComplete = shouldCloseOnAnimComplete;
     this.closeModalResult          = modalResult;
     this.AnimatingState            = PersistentScreenState.Closing;
     this.OnAnimationComplete(0u, null);
     Service.EventManager.SendEvent(EventId.UpdateScrim, null);
 }
Beispiel #4
0
 private void PlayAnimation(bool openScreen)
 {
     if (openScreen)
     {
         this.AnimatingState  = PersistentScreenState.Opening;
         this.animState.speed = 1f;
         this.animState.time  = 0f;
     }
     else
     {
         this.AnimatingState  = PersistentScreenState.Closing;
         this.animState.speed = -1f;
         this.animState.time  = this.animState.length;
     }
     this.animationTimer = Service.ViewTimerManager.CreateViewTimer(this.animState.length, false, new TimerDelegate(this.OnAnimationComplete), null);
     this.openCloseAnim.Play();
     Service.EventManager.SendEvent(EventId.UpdateScrim, null);
 }