コード例 #1
0
        public GameResultScore(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager,
                               PPDGameUtility ppdGameUtility, ISound sound, ITweetManager tweetManager, IReviewManager reviewManager, IGameHost gameHost) : base(device)
        {
            this.ppdGameUtility = ppdGameUtility;
            this.TweetManager   = tweetManager;
            this.ReviewManager  = reviewManager;
            this.Sound          = sound;
            this.gameHost       = gameHost;
            menuRanking         = new MenuRanking(device, resourceManager)
            {
                Position = new Vector2(455, 100)
            };
            td = new TweetDialog(device, resourceManager, sound, tweetManager);
            rd = new ReviewDialog(device, resourceManager, sound, reviewManager);
            this.AddChild(td);
            this.AddChild(rd);
            result = new EffectObject[6];
            for (int i = 0; i < result.Length; i++)
            {
                int x    = 220;
                int y    = 74;
                var anim = new EffectObject(device, resourceManager, Utility.Path.Combine("result", String.Format("{0}.etd", ((ResultEvaluateType)i).ToString().ToLower())))
                {
                    Position = new Vector2(x, y)
                };
                anim.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
                anim.Play();
                result[i] = anim;
            }
            string filename = "";

            switch (ppdGameUtility.Difficulty)
            {
            case Difficulty.Easy:
                filename = "easy.png";
                break;

            case Difficulty.Normal:
                filename = "normal.png";
                break;

            case Difficulty.Hard:
                filename = "hard.png";
                break;

            case Difficulty.Extreme:
                filename = "extreme.png";
                break;

            default:
                filename = "normal.png";
                break;
            }
            difficulty = new PictureObject(device, resourceManager, Utility.Path.Combine("result", filename))
            {
                Position = new Vector2(45, 105)
            };
            high = new EffectObject(device, resourceManager, Utility.Path.Combine("result", "high.etd"))
            {
                Position = new Vector2(-25, 300)
            };
            high.PlayType = Effect2D.EffectManager.PlayType.Loop;
            high.Play();
            high.Alignment = EffectObject.EffectAlignment.TopLeft;
            scoresmalls    = new NumberPictureObject[6];
            for (int i = 0; i < scoresmalls.Length; i++)
            {
                scoresmalls[i] = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("result", "scoresmall.png"))
                {
                    Position  = new Vector2(scorex, scorey[i]),
                    Alignment = Alignment.Right,
                    MaxDigit  = -1
                };
            }
            scorebig = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("result", "scorebig.png"))
            {
                Position  = new Vector2(scorex, scorey[6]),
                Alignment = Alignment.Right,
                MaxDigit  = -1
            };
            scoreboard = new PictureObject(device, resourceManager, Utility.Path.Combine("result", "score.png"))
            {
                Position = new Vector2(18, 52)
            };
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "cool.png"), true)
            {
                Position = new Vector2(105, 108),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "good.png"), true)
            {
                Position = new Vector2(105, 138),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "safe.png"), true)
            {
                Position = new Vector2(105, 168),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "sad.png"), true)
            {
                Position = new Vector2(105, 198),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "worst.png"), true)
            {
                Position = new Vector2(105, 228),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "combo.png"), true)
            {
                Position = new Vector2(105, 258),
                Scale    = new Vector2(0.75f, 0.75f)
            });

            top = new PictureObject(device, resourceManager, Utility.Path.Combine("result", "top.png"));
            top.AddChild(new TextureString(device, Utility.Language["Result"], 20, PPDColors.White)
            {
                Position = new Vector2(70, 2)
            });
            bottom = new PictureObject(device, resourceManager, Utility.Path.Combine("result", "bottom.png"));
            bottom.AddChild(new TextureString(device, Utility.Language["Move"], 16, PPDColors.White)
            {
                Position = new Vector2(587, 21)
            });
            bottom.AddChild(new TextureString(device, Utility.Language["Decide"], 16, PPDColors.White)
            {
                Position = new Vector2(708, 21)
            });
            bottom.Position = new Vector2(0, 450 - bottom.Height + 1);
            black           = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800
            };
            black.Alpha = 0;
            buttons     = new Button[5];
            for (int i = 0; i < buttons.Length; i++)
            {
                string text = "";
                switch (i)
                {
                case 0:
                    text = "TWEET";
                    break;

                case 1:
                    text = "REVIEW";
                    break;

                case 2:
                    text = "RETRY";
                    break;

                case 3:
                    text = "REPLAY";
                    break;

                case 4:
                    text = "RETURN";
                    break;
                }
                Vector2 pos;
                if (i >= 2)
                {
                    pos = new Vector2(500 + ((i - 2) % 3) * 100, 380);
                }
                else
                {
                    pos = new Vector2(500 + (i % 2) * 100, 340);
                }
                buttons[i] = new Button(device, resourceManager, Utility.Path, text)
                {
                    Position = pos
                };
                gridSelection.Add(pos);
                buttons[i].Selected = false;
                this.AddChild(buttons[i]);
            }
            gridSelection.Initialize();
            songname = new TextureString(device, ppdGameUtility.SongInformation.DirectoryName, 20, 500, PPDColors.White)
            {
                Position = new Vector2(35, 4)
            };
            songname.Position = new Vector2(790 - songname.JustWidth, songname.Position.Y);
            difficultstring   = new TextureString(device, ppdGameUtility.DifficultString, 24, 200, PPDColors.White)
            {
                Position    = new Vector2(35, 103),
                AllowScroll = true
            };
            difficultstring.Position = new Vector2(400 - Math.Min(200, difficultstring.Width), difficultstring.Position.Y);

            bgd = new BackGroundDisplay(device, resourceManager, "skins\\PPDSingle_BackGround.xml", "Result");

            Inputed    += GameResultScore_Inputed;
            GotFocused += GameResultScore_GotFocused;

            this.AddChild(menuRanking);
            this.AddChild(high);
            this.AddChild(difficulty);
            for (int i = 0; i < result.Length; i++)
            {
                this.AddChild(result[i]);
            }
            for (int i = 0; i < scoresmalls.Length; i++)
            {
                this.AddChild(scoresmalls[i]);
            }
            this.AddChild(scorebig);
            this.AddChild(difficultstring);
            this.AddChild(scoreboard);
            this.AddChild(songname);
            this.AddChild(top);
            this.AddChild(bottom);
            this.AddChild(bgd);

            this.InsertChild(black, 0);
        }
コード例 #2
0
        public SongInfoControl(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
        {
            menuRanking = new MenuRanking(device, resourceManager)
            {
                Position = new Vector2(500, 105)
            };
            menuRanking.Hidden = true;
            this.AddChild(menuRanking);
            state          = State.normal;
            infoboards     = new PictureObject[2];
            bestEvaluates  = new BestEvaluate[4];
            buttonAcs      = new PictureObject[4];
            buttonFts      = new PictureObject[4];
            buttonPerfects = new PictureObject[4];
            acs            = new PictureObject[4];
            fts            = new PictureObject[4];
            perfects       = new PictureObject[4];
            infoboards[0]  = new PictureObject(device, resourceManager, Utility.Path.Combine("infoboard1.png"))
            {
                Position = new Vector2(520, height - 14)
            };
            infoboards[1] = new PictureObject(device, resourceManager, Utility.Path.Combine("infoboard2.png"))
            {
                Position = new Vector2(500, 280)
            };
            infoboards[1].Hidden = true;
            this.AddChild(infoboards[0]);
            this.AddChild(infoboards[1]);
            TextureString easy, normal, hard, extreme;

            infoboards[0].AddChild(new TextureString(device, "BPM", 20, PPDColors.White)
            {
                Position = new Vector2(0, 15)
            });
            infoboards[0].AddChild(easy = new TextureString(device, "EASY", 20, PPDColors.White)
            {
                Position = new Vector2(0, 45)
            });
            infoboards[0].AddChild(normal = new TextureString(device, "NORMAL", 20, PPDColors.White)
            {
                Position = new Vector2(0, 75)
            });
            infoboards[0].AddChild(hard = new TextureString(device, "HARD", 20, PPDColors.White)
            {
                Position = new Vector2(0, 105)
            });
            infoboards[0].AddChild(extreme = new TextureString(device, "EXTREME", 20, PPDColors.White)
            {
                Position = new Vector2(0, 135)
            });
            infoboards[0].AddChild(new TextureString(device, "S.A.", 20, PPDColors.White)
            {
                Position = new Vector2(0, 165)
            });
            foreach (GameComponent gc in infoboards[0].Children)
            {
                gc.Position = new Vector2(90 - gc.Width, gc.Position.Y);
            }
            for (int i = 0; i < 4; i++)
            {
                infoboards[0].InsertChild(acs[i] = new PictureObject(device, resourceManager, Utility.Path.Combine("ac.png"))
                {
                    Position = new Vector2(0, 35 + 30 * i)
                }, 0);

                infoboards[0].InsertChild(fts[i] = new PictureObject(device, resourceManager, Utility.Path.Combine("ft.png"))
                {
                    Position = new Vector2(0, 35 + 30 * i)
                }, 0);

                infoboards[0].InsertChild(perfects[i] = new PictureObject(device, resourceManager, Utility.Path.Combine("perfect.png"))
                {
                    Position = new Vector2(35, 35 + 30 * i)
                }, 0);

                infoboards[0].InsertChild(bestEvaluates[i] = new BestEvaluate(device, resourceManager)
                {
                    Position = new Vector2(80, 35 + 30 * i)
                }, 0);
            }
            infos = new TextureString[6];
            for (int i = 0; i < 6; i++)
            {
                var st = new TextureString(device, "", 20, 150, PPDColors.White)
                {
                    Position = new Vector2(100, 15 + 30 * i)
                };
                infos[i] = st;
                infoboards[0].AddChild(st);
            }
            focusedbpm = new TextureString(device, "BPM", 12, true, PPDColors.White)
            {
                Position = new Vector2(140, 10)
            };
            hiscore = new TextureString(device, "BPM", 12, true, PPDColors.White)
            {
                Position = new Vector2(140, 30)
            };
            difficulty = new TextureString(device, "BPM", 12, true, PPDColors.White)
            {
                Position = new Vector2(140, 50)
            };
            infoboards[1].AddChild(focusedbpm);
            infoboards[1].AddChild(hiscore);
            infoboards[1].AddChild(difficulty);
            buttons = new Button[4];
            for (int i = 0; i < buttons.Length; i++)
            {
                string text = "";
                switch (i)
                {
                case 0:
                    text = "EASY";
                    break;

                case 1:
                    text = "NORMAL";
                    break;

                case 2:
                    text = "HARD";
                    break;

                case 3:
                    text = "EXTREME";
                    break;
                }
                infoboards[1].AddChild(buttonAcs[i] = new PictureObject(device, resourceManager, Utility.Path.Combine("ac.png"))
                {
                    Position = new Vector2(85 * i - 40, 75)
                });
                infoboards[1].AddChild(buttonFts[i] = new PictureObject(device, resourceManager, Utility.Path.Combine("ft.png"))
                {
                    Position = new Vector2(85 * i - 40, 75)
                });
                infoboards[1].AddChild(buttonPerfects[i] = new PictureObject(device, resourceManager, Utility.Path.Combine("perfect.png"))
                {
                    Position = new Vector2(85 * i - 40 + 30, 75)
                });
                buttons[i] = new Button(device, resourceManager, Utility.Path, text)
                {
                    Position = new Vector2(85 * i, 100)
                };
                infoboards[1].AddChild(buttons[i]);
            }

            GotFocused  += SongInfoControl_GotFocused;
            LostFocused += SongInfoControl_LostFocused;
        }