Beispiel #1
0
        protected override void UpdateImpl()
        {
            if (initialized)
            {
                thumbSprite.Position = new SharpDX.Vector2(AnimationUtility.GetAnimationValue(thumbSprite.Position.X, -(currentParent.Depth) * 200), 0);
                foreach (GameComponent gc in thumbSprite.Children)
                {
                    var thumbList = gc as ThumbList;
                    thumbList.Position = new SharpDX.Vector2(thumbList.Position.X, AnimationUtility.GetAnimationValue(thumbList.Position.Y, -100 * thumbList.CurrentIndex, 0.2f));
                }

                for (int i = removeList.Count - 1; i >= 0; i--)
                {
                    removeList[i].Alpha = AnimationUtility.DecreaseAlpha(removeList[i].Alpha);
                }

                if (updateCount >= 200 && playing)
                {
                    this[1].Alpha = AnimationUtility.DecreaseAlpha(this[1].Alpha);
                }
                else
                {
                    this[1].Alpha = AnimationUtility.IncreaseAlpha(this[1].Alpha);
                }

                updateCount++;
            }
        }
Beispiel #2
0
        protected override void UpdateImpl()
        {
            for (int i = 0; i < strings.Length; i++)
            {
                float alpha = (hbm.CurrentMode == (HomeBottomMenu.Mode)i) ? AnimationUtility.IncreaseAlpha(strings[i].Alpha) : AnimationUtility.DecreaseAlpha(strings[i].Alpha);
                if (hbm.CurrentMode == (HomeBottomMenu.Mode)i)
                {
                    if (alpha >= 0.999f)
                    {
                        drawCount++;
                    }
                }
                strings[i].Alpha = alpha;
            }

            if (drawCount >= 60 && operated)
            {
                this.Alpha    = AnimationUtility.DecreaseAlpha(this.Alpha, 0.2f);
                this.Position = new SharpDX.Vector2(0, AnimationUtility.GetAnimationValue(this.Position.Y, -30));
            }
            else
            {
                this.Alpha    = AnimationUtility.IncreaseAlpha(this.Alpha, 0.2f);
                this.Position = new SharpDX.Vector2(0, AnimationUtility.GetAnimationValue(this.Position.Y, 0));
            }

            operated |= drawCount >= 200;
        }
Beispiel #3
0
        protected override void UpdateImpl()
        {
            drawCount++;

            if (drawCount >= 60)
            {
                foreach (GameComponent gc in evals)
                {
                    gc.Hidden = true;
                }
            }

            if (score < trueScore)
            {
                if (trueScore - score < 99)
                {
                    score = trueScore;
                }
                else
                {
                    score += Math.Max((trueScore - score) / 60, 99);
                }
            }
            if (scorePicture.Value != score)
            {
                scorePicture.Value = (uint)score;
            }

            this.Alpha = userPlayState.IsStealth ? AnimationUtility.DecreaseAlpha(this.Alpha) : AnimationUtility.IncreaseAlpha(this.Alpha);
        }
Beispiel #4
0
 protected override void UpdateImpl()
 {
     if (OverFocused)
     {
         back.Position = new SharpDX.Vector2(0, AnimationUtility.GetAnimationValue(back.Position.Y, 0));
         Alpha         = AnimationUtility.IncreaseAlpha(Alpha);
     }
     else
     {
         back.Position = new SharpDX.Vector2(0, AnimationUtility.GetAnimationValue(back.Position.Y, 50));
         Alpha         = AnimationUtility.DecreaseAlpha(Alpha);
     }
     resultSprite.Clip = new ClipInfo(gameHost)
     {
         PositionX = 40,
         PositionY = (int)(SpriteY + back.Position.Y),
         Width     = 750,
         Height    = ClipHeight
     };
     resultSprite.Position = new Vector2(resultSprite.Position.X,
                                         AnimationUtility.GetAnimationValue(resultSprite.Position.Y, +SpriteY - 38 * scrollIndex));
     scrollBar.Position = new Vector2(
         scrollBar.Position.X,
         AnimationUtility.GetAnimationValue(
             scrollBar.Position.Y,
             resultSprite.ChildrenCount <= MaxDisplayCount ?
             SpriteY :
             SpriteY + ScrollBarHeight * scrollIndex / resultSprite.ChildrenCount));
 }
Beispiel #5
0
        public override void Update(InputInfoBase inputInfo, MouseInfo mouseInfo)
        {
            inputInfo = new MenuInputInfo(inputInfo);
            focusManager.ProcessInput(inputInfo);

            foreach (HomePanelBase panel in panelList.Values)
            {
                panel.Alpha = panel != currentPanel?AnimationUtility.DecreaseAlpha(panel.Alpha) : AnimationUtility.IncreaseAlpha(panel.Alpha);
            }
            UpdateMouseInfo(mouseInfo);
            Update();
        }
Beispiel #6
0
 protected override void UpdateImpl()
 {
     if (OverFocused)
     {
         back.Position = new SharpDX.Vector2(0, AnimationUtility.GetAnimationValue(back.Position.Y, 0));
         Alpha         = AnimationUtility.IncreaseAlpha(Alpha);
     }
     else
     {
         back.Position = new SharpDX.Vector2(0, AnimationUtility.GetAnimationValue(back.Position.Y, 50));
         Alpha         = AnimationUtility.DecreaseAlpha(Alpha);
     }
 }
Beispiel #7
0
        protected override void UpdateImpl()
        {
            float nextX = 0;

            for (int i = 0; i < icons.Length; i++)
            {
                float newScale = (int)mode == i?AnimationUtility.IncreaseAlpha(icons[i].Scale.X) : AnimationUtility.GetAnimationValue(icons[i].Scale.X, 0.5f);

                if ((int)mode == i)
                {
                    if (newScale >= 0.999f)
                    {
                        drawCount++;
                    }
                }

                icons[i].Scale    = new SharpDX.Vector2(newScale, newScale);
                icons[i].Position = new SharpDX.Vector2(nextX + newScale * icons[i].Width / 2, 0);
                nextX             = icons[i].Position.X + icons[i].Width * newScale / 2 + 10;
            }
            float diff = 400 - (ModeArray.Length % 2 == 0 ? (icons[ModeArray.Length / 2 - 1].Position.X + icons[ModeArray.Length / 2].Position.X) / 2 : icons[ModeArray.Length / 2].Position.X);

            for (int i = 0; i < icons.Length; i++)
            {
                icons[i].Position = new SharpDX.Vector2(icons[i].Position.X + diff, 0);
            }
            for (int i = 0; i < strings.Length; i++)
            {
                strings[i].Position = new SharpDX.Vector2(icons[i].Position.X, -45);
                strings[i].Alpha    = (icons[i].Scale.X - 0.5f) * 2;
            }

            if (drawCount >= 60 && operated)
            {
                this.Alpha    = AnimationUtility.DecreaseAlpha(this.Alpha, 0.2f);
                this.Position = new SharpDX.Vector2(0, AnimationUtility.GetAnimationValue(this.Position.Y, 480));
            }
            else
            {
                this.Alpha    = AnimationUtility.IncreaseAlpha(this.Alpha, 0.2f);
                this.Position = new SharpDX.Vector2(0, AnimationUtility.GetAnimationValue(this.Position.Y, 421));
            }

            operated |= drawCount >= 200;
        }
Beispiel #8
0
        protected override void UpdateImpl()
        {
            ballRect.Position += ballVector;
            Check();
            Move();

            if (EffectExpired)
            {
                Alpha = AnimationUtility.DecreaseAlpha(Alpha);
                if (Alpha <= 0)
                {
                    Parent.RemoveChild(this);
                }
            }
            else
            {
                Alpha = AnimationUtility.IncreaseAlpha(Alpha);
            }
        }
Beispiel #9
0
            protected override void UpdateImpl()
            {
                if (moviePlayer != null)
                {
                    if (moviePlayer.Movie != null && moviePlayer.Movie.Initialized)
                    {
                        moviePos.Text     = String.Format("{0}/{1}", GetTime(moviePlayer.Movie.MoviePosition), GetTime(moviePlayer.Movie.Length));
                        moviePos.Position = new SharpDX.Vector2(-moviePos.Width - 75, moviePos.Position.Y);
                    }

                    play.Selected = pause.Selected;
                    play.Alpha    = moviePlayer.Movie.Playing ? AnimationUtility.DecreaseAlpha(play.Alpha) : AnimationUtility.IncreaseAlpha(play.Alpha);
                    pause.Alpha   = 1 - play.Alpha;

                    randomLoop.Selected = secLoop.Selected = oneLoop.Selected;
                    foreach (var p in loopDict)
                    {
                        p.Value.Alpha = p.Key == PPDGeneralSetting.Setting.MovieLoopType ? AnimationUtility.IncreaseAlpha(p.Value.Alpha) : AnimationUtility.DecreaseAlpha(p.Value.Alpha);
                    }
                }

                this.Alpha = Focused ? AnimationUtility.IncreaseAlpha(this.Alpha) : AnimationUtility.DecreaseAlpha(this.Alpha);
            }
Beispiel #10
0
        protected override void UpdateImpl()
        {
            int iter = 0;

            foreach (GameComponent gc in Children)
            {
                gc.Alpha = AnimationUtility.IncreaseAlpha(gc.Alpha);
                var x = AnimationUtility.GetAnimationValue(gc.Position.X, 210 * (iter % 2));
                var y = AnimationUtility.GetAnimationValue(gc.Position.Y, iter / 2 * 50);
                gc.Position = new SharpDX.Vector2(x, y);
                iter++;
            }
            if (nameAnimCount >= 0)
            {
                if (CurrentAlpha > 0)
                {
                    nameAnimCount++;
                    if (nameAnimCount > 300)
                    {
                        CurrentAlpha = AnimationUtility.DecreaseAlpha(CurrentAlpha);
                        if (CurrentAlpha == 0)
                        {
                            nameAnimCount = -1;
                            isNameVisible = !isNameVisible;
                        }
                    }
                }
            }
            else
            {
                CurrentAlpha = AnimationUtility.IncreaseAlpha(CurrentAlpha);
                if (CurrentAlpha == 1)
                {
                    nameAnimCount = 0;
                }
            }
        }
Beispiel #11
0
        protected override void UpdateImpl()
        {
            this.Alpha             = AnimationUtility.IncreaseAlpha(this.Alpha);
            contentSprite.Position = new SharpDX.Vector2(AnimationUtility.GetAnimationValue(contentSprite.Position.X, -currentPageIndex * 800), 0);

            left.Alpha = currentPageIndex != 0 ? AnimationUtility.IncreaseAlpha(left.Alpha) : AnimationUtility.DecreaseAlpha(left.Alpha);

            if (clickedTextButton != null)
            {
                bool found = false;
                if (myGame.Input.GetPressedButton(out int button))
                {
                    keyConfig.SetButtonMap((ButtonType)clickedTextButton.Index, button);
                    buttons[clickedTextButton.Index].Text = button.ToString();
                    found = true;
                }
                if (myGame.Input.GetPressedKey(out Key key))
                {
                    keyConfig.SetKeyMap((ButtonType)clickedTextButton.Index, key);
                    keys[clickedTextButton.Index].Text = key.ToString();
                    found = true;
                }

                if (found)
                {
                    clickedTextButton.Text  = Utility.Language["Change"];
                    clickedTextButton       = null;
                    myGame.Input.AssignMode = false;
                }
            }
        }
Beispiel #12
0
 protected override void UpdateImpl()
 {
     check.Hidden   = !ModInfo.IsApplied;
     checkBox.Alpha = Selected ? AnimationUtility.IncreaseAlpha(checkBox.Alpha) : AnimationUtility.DecreaseAlpha(checkBox.Alpha);
 }
Beispiel #13
0
        public override void Update(InputInfoBase inputInfo, MouseInfo mouseInfo)
        {
            switch (state)
            {
            case State.Loading:
                drawRatio = AnimationUtility.GetAnimationValue(drawRatio, currentRatio / 100);
                if (drawRatio == 1)
                {
                    state           = State.Complete;
                    bootImage.Alpha = 0;
                }
                rect.Position        = new Vector2(400 - drawRatio * 100, 223);
                rect.RectangleHeight = 4;
                rect.RectangleWidth  = drawRatio * 200;
                break;

            case State.Complete:
                completeImage.Alpha = AnimationUtility.IncreaseAlpha(completeImage.Alpha);
                if (completeImage.Alpha == 1)
                {
                    state = State.Fading;
                }
                break;

            case State.Fading:
                completeImage.Alpha = loadPercentImage.Alpha = percentImage.Alpha = outCircle.Alpha = AnimationUtility.DecreaseAlpha(outCircle.Alpha);
                if (completeImage.Alpha == 0)
                {
                    state = State.Expanding;
                }
                break;

            case State.Expanding:
                rect.Position         = new Vector2(400 - drawRatio * 100, 223);
                rect.RectangleHeight  = 4;
                rect.RectangleWidth   = drawRatio * 200;
                drawRatio             = AnimationUtility.GetAnimationValue(drawRatio, 4);
                provideImage.Position = AnimationUtility.GetAnimationPosition(provideImage.Position, new Vector2(20, provideImage.Position.Y));
                if (drawRatio == 4)
                {
                    state = State.Hiding;
                }
                break;

            case State.Hiding:
                provideImage.Position = AnimationUtility.GetAnimationPosition(provideImage.Position, new Vector2(900, provideImage.Position.Y));
                if (provideImage.Position.X >= 800)
                {
                    this.AddChild(HomeScene);
                    state = State.Showing;
                }
                break;

            case State.Showing:

                topBlack.Position    = AnimationUtility.GetAnimationPosition(topBlack.Position, new Vector2(0, -230));
                bottomBlack.Position = AnimationUtility.GetAnimationPosition(bottomBlack.Position, new Vector2(0, 460));

                if (topBlack.Position.Y <= -225)
                {
                    SceneManager.CurrentScene = HomeScene;
                }

                HomeScene.Update(EmptyInputInfo.Instance, MouseInfo.Empty);
                break;
            }

            HomeScene.Hidden       = topBlack.Hidden = bottomBlack.Hidden = state < State.Showing;
            rect.Hidden            = state >= State.Showing;
            loadPercentImage.Value = (uint)(drawRatio * 100);
            circle.Ratio           = state >= State.Fading ? completeImage.Alpha : drawRatio;
            circle.Inverse         = state >= State.Fading;
            Update();
        }
Beispiel #14
0
        protected override void UpdateImpl()
        {
            if (initialized)
            {
                if (loader.Finished)
                {
                    loader.Finished = false;
                    if (!loader.Error)
                    {
                        int iter = 0;
                        foreach (Feed feed in loader.List)
                        {
                            left.AddChild(new TextureString(device, feed.Date.ToShortDateString(), 14, PPDColors.White)
                            {
                                Position = new SharpDX.Vector2(40, 10 + 20 * iter)
                            });
                            iter++;
                        }
                        feedSprite.AddChild(new FeedComponent(device, resourceManager, loader.List[0]));
                    }
                }

                feedSprite.Position    = new SharpDX.Vector2(feedSprite.Position.X, AnimationUtility.GetAnimationValue(feedSprite.Position.Y, -currentIndex * 450));
                leftSelection.Position = new SharpDX.Vector2(leftSelection.Position.X, AnimationUtility.GetAnimationValue(leftSelection.Position.Y, currentIndex * 20 + 17));
                errorString.Alpha      = loader.Error ? AnimationUtility.IncreaseAlpha(errorString.Alpha) : AnimationUtility.DecreaseAlpha(errorString.Alpha);
            }
        }