Example #1
0
        public GameRuleComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.resourceManager = resourceManager;
            this.sound           = sound;

            this.AddChild(back = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.75f
            });

            back.AddChild(ruleSprite = new SpriteObject(device));
            ruleSprite.AddChild(itemSupplyTypeSprite = new SpriteObject(device));
            back.AddChild(new TextureString(device, Utility.Language["ChangeRule"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });

            ruleSprite.AddChild(resultSort = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["RankOrder"], Utility.Language["Score"], Utility.Language["Accuracy"])
            {
                Position = new SharpDX.Vector2(80, 80),
                Selected = true
            });
            ruleSprite.AddChild(itemAvailable = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ItemAvailable"])
            {
                Position = new SharpDX.Vector2(50, 120)
            });
            ruleSprite.AddChild(okButton = new ButtonComponent(device, resourceManager, Utility.Path, Utility.Language["OK"])
            {
                Position = new Vector2(270, 380)
            });
            ruleSprite.AddChild(cancelButton = new ButtonComponent(device, resourceManager, Utility.Path, Utility.Language["Cancel"])
            {
                Position = new Vector2(470, 380)
            });
            ruleSprite.AddChild(maxItemCount = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["MaxItemCount"], 1, 2, 3, 4, 5, 6)
            {
                Position = new Vector2(110, 160)
            });
            itemSupplyTypeSprite.AddChild(comboSupply = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["DependentOnComboOrWorst"])
            {
                Position = new Vector2(80, 200)
            });
            ruleSprite.AddChild(comboSupplyCount = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ItemPerCombo"], 50, 60, 70, 80, 90, 100)
            {
                Position = new Vector2(130, 240)
            });
            ruleSprite.AddChild(worstSupplyCount = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ItemPerWorst"], 50, 60, 70, 80, 90, 100)
            {
                Position = new Vector2(130, 280)
            });
            itemSupplyTypeSprite.AddChild(rankSupply = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["DependentOnRank"])
            {
                Position = new Vector2(80, 320)
            });

            selectList = new SelectableComponent[] {
                resultSort,
                itemAvailable,
                maxItemCount,
                comboSupply,
                comboSupplyCount,
                worstSupplyCount,
                rankSupply,
                okButton,
                cancelButton
            };
            gridSelection = new GridSelection();
            foreach (SelectableComponent comp in selectList)
            {
                gridSelection.Add(comp.Position);
            }
            resultSort.SelectedItem       = Utility.Language[gameRule.ResultSortType.ToString()];
            itemAvailable.Checked         = gameRule.ItemAvailable;
            comboSupply.Checked           = gameRule.ItemSupplyType == ItemSupplyType.ComboWorstCount;
            rankSupply.Checked            = gameRule.ItemSupplyType == ItemSupplyType.Rank;
            comboSupplyCount.SelectedItem = gameRule.ItemSupplyComboCount;
            worstSupplyCount.SelectedItem = gameRule.ItemSupplyWorstCount;
            maxItemCount.SelectedItem     = gameRule.MaxItemCount;

            Inputed    += ItemSettingComponent_Inputed;
            GotFocused += ItemSettingComponent_GotFocused;
        }
Example #2
0
        protected GeneralDialogBase(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager,
                                    ISound sound, string displayText, string[] buttonTexts) : base(device)
        {
            this.sound = sound;
            selection  = new GridSelection();
            sprite     = new SpriteObject(device);
            back       = new EffectObject(device, resourceManager, Utility.Path.Combine("tweetconfirm.etd"))
            {
                Position = new Vector2(400, 225)
            };
            message = new TextureString(device, displayText, 16, 340, 300, true, PPDColors.White)
            {
                Position = new Vector2(230, 120)
            };

            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800
            };

            buttons = new Button[buttonTexts.Length];
            if (buttons.Length == 1)
            {
                buttons[0] = new Button(device, resourceManager, Utility.Path, buttonTexts[0])
                {
                    Position = new Vector2(400, 315)
                };
                buttons[0].Selected = false;
                sprite.AddChild(buttons[0]);
                selection.Add(buttons[0].Position);
            }
            else
            {
                rowCount = (int)Math.Ceiling(buttonTexts.Length / 2f);
                for (int i = 0; i < buttons.Length; i++)
                {
                    int rowIndex    = i / 2;
                    int columnIndex = i % 2;
                    buttons[i] = new Button(device, resourceManager, Utility.Path, buttonTexts[i])
                    {
                        Position = new Vector2(300 + columnIndex * 200, 315 - (rowCount - rowIndex - 1) * 50)
                    };
                    buttons[i].Selected = false;
                    sprite.AddChild(buttons[i]);
                    selection.Add(buttons[i].Position);
                }
            }

            buttons[0].Selected = true;

            black.Alpha = 0;

            back.Hidden   = true;
            sprite.Hidden = true;

            GotFocused  += PreviewPlayDialog_GotFocused;
            LostFocused += PreviewPlayDialog_LostFocused;
            Inputed     += PreviewPlayDialog_Inputed;

            sprite.AddChild(message);

            this.AddChild(sprite);
            this.AddChild(back);
            this.AddChild(black);
        }
Example #3
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);
        }
Example #4
0
        public FilterControl(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, SongSelectFilter filter) : base(device)
        {
            this.sound  = sound;
            this.filter = filter;
            selection   = new GridSelection();

            PictureObject back;

            var mainSprite = new SpriteObject(device);

            mainSprite.AddChild(new TextureString(device, Utility.Language["SortField"], 22, PPDColors.White)
            {
                Position = new Vector2(50, 80)
            });
            var sortFieldSprite = new SpriteObject(device);

            this.AddChild(sortFieldSprite);
            sortFieldSprite.AddChild(nameRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Name"])
            {
                Position = new Vector2(80, 120),
                Selected = true
            });
            nameRadio.Update();
            sortFieldSprite.AddChild(timeRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Time"])
            {
                Position = new Vector2(nameRadio.Position.X + nameRadio.Width + Margin, 120)
            });
            timeRadio.Update();
            sortFieldSprite.AddChild(updateDateRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["UpdateDate"])
            {
                Position = new Vector2(timeRadio.Position.X + timeRadio.Width + Margin, 120)
            });
            updateDateRadio.Update();
            sortFieldSprite.AddChild(bpmRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["BPM"])
            {
                Position = new Vector2(updateDateRadio.Position.X + updateDateRadio.Width + Margin, 120)
            });
            bpmRadio.Update();
            sortFieldSprite.AddChild(authorRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Author"])
            {
                Position = new Vector2(bpmRadio.Position.X + bpmRadio.Width + Margin, 120)
            });

            mainSprite.AddChild(new TextureString(device, Utility.Language["SortOrder"], 22, PPDColors.White)
            {
                Position = new Vector2(50, 160)
            });
            var sortOrderSprite = new SpriteObject(device);

            this.AddChild(sortOrderSprite);
            sortOrderSprite.AddChild(ascRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Ascendant"])
            {
                Position = new Vector2(80, 200)
            });
            nameRadio.Update();
            sortOrderSprite.AddChild(descRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Descendant"])
            {
                Position = new Vector2(ascRadio.Position.X + ascRadio.Width + Margin, 200)
            });

            mainSprite.AddChild(new TextureString(device, Utility.Language["Type"], 22, PPDColors.White)
            {
                Position = new Vector2(50, 240)
            });
            mainSprite.AddChild(easyCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "EASY")
            {
                Position = new Vector2(80, 280)
            });
            easyCheck.Update();
            mainSprite.AddChild(normalCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "NORMAL")
            {
                Position = new Vector2(easyCheck.Position.X + easyCheck.Width + Margin, 280)
            });
            normalCheck.Update();
            mainSprite.AddChild(hardCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "HARD")
            {
                Position = new Vector2(normalCheck.Position.X + normalCheck.Width + Margin, 280)
            });
            hardCheck.Update();
            mainSprite.AddChild(extremeCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "EXTREME")
            {
                Position = new Vector2(hardCheck.Position.X + hardCheck.Width + Margin, 280)
            });
            mainSprite.AddChild(normalScoreCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["NormalScore"])
            {
                Position = new Vector2(80, 320)
            });
            normalScoreCheck.Update();
            mainSprite.AddChild(acScoreCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ACScore"])
            {
                Position = new Vector2(normalScoreCheck.Position.X + normalScoreCheck.Width + Margin, 320)
            });
            acScoreCheck.Update();
            mainSprite.AddChild(acftScoreCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ACFTScore"])
            {
                Position = new Vector2(acScoreCheck.Position.X + acScoreCheck.Width + Margin, 320)
            });

            mainSprite.AddChild(setDefaultButton = new ButtonComponent(device, resourceManager, Utility.Path, Utility.Language["SetDefault"])
            {
                Position = new Vector2(300, 370)
            });

            selectList = new SelectableComponent[] {
                nameRadio,
                timeRadio,
                updateDateRadio,
                bpmRadio,
                authorRadio,
                ascRadio,
                descRadio,
                easyCheck,
                normalCheck,
                hardCheck,
                extremeCheck,
                normalScoreCheck,
                acScoreCheck,
                acftScoreCheck,
                setDefaultButton
            };
            foreach (SelectableComponent comp in selectList)
            {
                selection.Add(comp.Position);
            }

            this.AddChild(mainSprite);
            this.AddChild(back = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            });
            back.AddChild(new TextureString(device, Utility.Language["Filter"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });

            Inputed     += FilterControl_Inputed;
            GotFocused  += FilterControl_GotFocused;
            LostFocused += FilterControl_LostFocused;
        }