Esempio n. 1
0
        public static bool Draw()
        {
            if ((NextScreen != EScreens.ScreenNull) && !_Fading)
            {
                _Fading = true;
                _FadingTimer.Reset();
                _FadingTimer.Start();
                Screens[(int)NextScreen].OnShow();
            }

            if (_Fading)
            {
                long FadeTime = (long)(CConfig.FadeTime * 1000);

                if ((_FadingTimer.ElapsedMilliseconds < FadeTime) && (CConfig.FadeTime > 0))
                {
                    long ms = 1;
                    if (_FadingTimer.ElapsedMilliseconds > 0)
                    {
                        ms = _FadingTimer.ElapsedMilliseconds;
                    }

                    float factor = (float)ms / FadeTime;

                    _GlobalAlpha = 1f;// -factor / 100f;
                    _ZOffset     = CSettings.zFar / 2;
                    Screens[(int)ActualScreen].Draw();

                    _GlobalAlpha = factor;
                    _ZOffset     = 0f;
                    Screens[(int)NextScreen].Draw();

                    _GlobalAlpha = 1f;
                }
                else
                {
                    Screens[(int)ActualScreen].OnClose();
                    ActualScreen = NextScreen;
                    NextScreen   = EScreens.ScreenNull;
                    Screens[(int)ActualScreen].OnShowFinish();
                    Screens[(int)ActualScreen].ProcessMouseMove(_Cursor.X, _Cursor.Y);
                    Screens[(int)ActualScreen].Draw();
                    _Fading = false;
                    _FadingTimer.Stop();
                }
            }
            else
            {
                Screens[(int)ActualScreen].Draw();
            }
            _Cursor.Draw();
            DrawDebugInfos();

            return(true);
        }
Esempio n. 2
0
        public static bool Draw()
        {
            if ((_NextScreen != EScreens.ScreenNull) && !_Fading)
            {
                _Fading = true;
                _FadingTimer.Reset();
                _FadingTimer.Start();
                _Screens[(int)_NextScreen].OnShow();
                HidePopup(EPopupScreens.PopupPlayerControl);
            }

            if (_Fading)
            {
                long FadeTime = (long)(CConfig.FadeTime * 1000);

                if ((_FadingTimer.ElapsedMilliseconds < FadeTime) && (CConfig.FadeTime > 0))
                {
                    long ms = 1;
                    if (_FadingTimer.ElapsedMilliseconds > 0)
                    {
                        ms = _FadingTimer.ElapsedMilliseconds;
                    }

                    float factor = (float)ms / FadeTime;

                    _GlobalAlpha = 1f;// -factor / 100f;
                    _ZOffset     = CSettings.zFar / 2;
                    _Screens[(int)_CurrentScreen].Draw();

                    _GlobalAlpha = factor;
                    _ZOffset     = 0f;
                    _Screens[(int)_NextScreen].Draw();

                    _GlobalAlpha = 1f;
                }
                else
                {
                    _Screens[(int)_CurrentScreen].OnClose();
                    _CurrentScreen = _NextScreen;
                    _NextScreen    = EScreens.ScreenNull;
                    if (CBackgroundMusic.Playing)
                    {
                        CBackgroundMusic.Play();
                    }
                    _Screens[(int)_CurrentScreen].OnShowFinish();
                    _Screens[(int)_CurrentScreen].ProcessMouseMove(_Cursor.X, _Cursor.Y);
                    _Screens[(int)_CurrentScreen].Draw();
                    _Fading = false;
                    _FadingTimer.Stop();
                }
            }
            else
            {
                _Screens[(int)_CurrentScreen].Draw();
            }

            for (int i = 0; i < _PopupScreens.Count; i++)
            {
                _PopupScreens[i].Draw();
            }

            _Cursor.Draw();
            DrawDebugInfos();

            return(true);
        }