Example #1
0
        public override void Load()
        {
            OnLoadProgressed(0);
            gameList             = new GameList();
            HandleOverFocusInput = true;

            listSprite = new SpriteObject(device);
            this.AddChild((select = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                RectangleWidth = 800, RectangleHeight = 90
            }));
            OnLoadProgressed(20);
            this.AddChild(listSprite);
            OnLoadProgressed(30);

            int iter = 0;

            foreach (GameLoader gl in gameList.List)
            {
                Add(gl);
                iter++;
                OnLoadProgressed(30 + 60 * iter / gameList.List.Length);
            }

            Inputed += GameListPanel_Inputed;
            OnLoadProgressed(100);
        }
Example #2
0
        public ScoreSearcher(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, DxTextBox textBox, SongSelectFilter filter) : base(device)
        {
            this.textBox = textBox;
            this.filter  = filter;

            back = new PictureObject(device, resourceManager, Utility.Path.Combine("searchback.png"), true)
            {
                Position = new Vector2(400, 234)
            };

            sif = new SongInfoFinder(filter);

            border = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                BorderThickness = 3,
                Hidden          = true
            };
            this.AddChild(border);
            results = new TextureString[12];
            for (int i = 0; i < results.Length; i++)
            {
                results[i] = new TextureString(device, "", 20, 300, PPDColors.Black)
                {
                    Position = new Vector2(240, 120 + 26 * i)
                };
                this.AddChild(results[i]);
            }


            Inputed    += ScoreSearcher_Inputed;
            GotFocused += ScoreSearcher_GotFocused;

            this.AddChild(back);
        }
Example #3
0
        public override void Load()
        {
            OnLoadProgressed(0);
            var temp = new SpriteObject(device);

            OnLoadProgressed(10);
            this.AddChild((controllerSprite = new SpriteObject(device)));
            movieController = new MovieController(device, resourceManager, null);
            controllerSprite.AddChild(movieController);
            OnLoadProgressed(20);
            this.AddChild(temp);
            OnLoadProgressed(30);
            temp.AddChild((selection = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                RectangleWidth = 180, RectangleHeight = 100, Position = new SharpDX.Vector2(10, 190)
            }));
            OnLoadProgressed(50);
            temp.AddChild((thumbSprite = new SpriteObject(device)));
            OnLoadProgressed(60);
            temp.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("leftmenu.png"))
            {
                Alpha = 0.5f, Scale = new SharpDX.Vector2(1.2f, 1)
            });
            OnLoadProgressed(80);
            this.AddChild((movieSprite = new SpriteObject(device)));
            OnLoadProgressed(90);

            GotFocused += MoviePanel_GotFocused;
            Inputed    += MoviePanel_Inputed;
            OnLoadProgressed(100);
        }
Example #4
0
        public ReplayListComponent(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.gameHost        = gameHost;
            this.resourceManager = resourceManager;
            this.sound           = sound;
            PictureObject back;

            waitSprite = new SpriteObject(device)
            {
                Hidden = true
            };
            this.AddChild(waitSprite);
            waitSprite.AddChild(new TextureString(device, Utility.Language["LoadingReplays"], 20, true, PPDColors.White)
            {
                Position = new Vector2(400, 220)
            });
            waitSprite.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            });
            rectangle = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                Hidden          = true,
                RectangleWidth  = 700,
                RectangleHeight = ItemHeight
            };
            this.AddChild(rectangle);
            mainSprite = new SpriteObject(device)
            {
                Position = new Vector2(50, SpriteY),
                Clip     = new ClipInfo(gameHost)
                {
                    PositionX = 40,
                    PositionY = ClipY,
                    Width     = 750,
                    Height    = ClipHeight
                }
            };
            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.80f
            });
            back.AddChild(new TextureString(device, Utility.Language["ReplayList"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });

            Inputed    += ReplayListComponent_Inputed;
            GotFocused += ReplayListComponent_GotFocused;
        }
Example #5
0
            public void DrawRectangle(Color color, float x, float y, float width, float height)
            {
                var lineRect = new LineRectangleComponent(Drawer.Device, Drawer.ResourceManager,
                                                          new SharpDX.Color4(color.R / 255f, color.G / 255f, color.B / 255f, color.A / 255f))
                {
                    Position        = new SharpDX.Vector2(x, y),
                    RectangleWidth  = width,
                    RectangleHeight = height,
                    BorderThickness = 1
                };

                Drawer.DrawTarget.InsertChild(lineRect, 0);
            }
Example #6
0
        public RoomListComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, IGameHost gameHost) : base(device)
        {
            this.resourceManager = resourceManager;
            this.sound           = sound;
            this.gameHost        = gameHost;

            this.AddChild(back    = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            back.AddChild(loading = new EffectObject(device, resourceManager, Utility.Path.Combine("loading_icon.etd"))
            {
                Position = new Vector2(700, 60)
            });
            back.AddChild(scrollBar = new RectangleComponent(device, resourceManager, PPDColors.White)
            {
                Position        = new Vector2(756, 80),
                RectangleHeight = 330,
                RectangleWidth  = 5
            });
            back.AddChild(selectRectangle = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                RectangleWidth = 714, RectangleHeight = 28
            });
            back.AddChild(new TextureString(device, Utility.Language["RoomList"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });
            back.AddChild(listSprite = new SpriteObject(device)
            {
                Position = new SharpDX.Vector2(38, 77)
            });

            loading.PlayType = Effect2D.EffectManager.PlayType.Loop;
            loading.Play();
            loading.Scale  = new Vector2(0.125f);
            loading.Hidden = true;

            getRoomListExecutor           = new GetRoomListExecutor();
            getRoomListExecutor.Finished += getRoomListExecutor_Finished;

            timerID = gameHost.AddTimerCallBack(timerCallBack, 15000, false, true);

            Inputed     += RoomListComponent_Inputed;
            LostFocused += RoomListComponent_LostFocused;
        }
Example #7
0
        public ModSettingPanel(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, ModInfo modInfo) : base(device)
        {
            this.gameHost        = gameHost;
            this.sound           = sound;
            this.resourceManager = resourceManager;
            this.modInfo         = modInfo;

            back  = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png"));
            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            };
            back.AddChild(new TextureString(device, String.Format("{0}-{1}", Utility.Language["ModSetting"], modInfo.FileName), 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });
            StackObject stackObject;

            back.AddChild(stackObject = new StackObject(device,
                                                        new StackObject(device,
                                                                        new SpaceObject(device, 0, 2),
                                                                        new PictureObject(device, resourceManager, Utility.Path.Combine("circle.png")))
            {
                IsHorizontal = false
            },
                                                        new TextureString(device, String.Format(":{0}", Utility.Language["ChangeSetting"]), 18, PPDColors.White))
            {
                IsHorizontal = true
            });
            stackObject.Update();
            stackObject.Position = new Vector2(760 - stackObject.Width, 50);

            settingSprite = new SpriteObject(device)
            {
                Position = new Vector2(50, SpriteY)
            };
            settingSprite.AddChild(settingListSprite = new SpriteObject(device)
            {
                Clip = new ClipInfo(gameHost)
                {
                    PositionX = 40,
                    PositionY = ClipY,
                    Width     = 750,
                    Height    = ClipHeight
                }
            });

            float height = 0;

            foreach (ModSetting modSetting in modInfo.Settings)
            {
                var component = new ModSettingComponent(device, resourceManager, modSetting,
                                                        modSetting.GetStringValue(modInfo.ModSettingManager[modSetting.Key]))
                {
                    Position = new Vector2(0, height)
                };
                component.Update();
                settingListSprite.AddChild(component);
                height += component.Height + 10;
            }
            CurrentComponent.IsSelected = true;

            settingSprite.AddChild(rectangle = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                RectangleWidth  = 700,
                RectangleHeight = 100
            });

            this.AddChild(settingSprite);
            this.AddChild(back);
            this.AddChild(black);

            UpdateBorderPosition(true);

            Inputed += ModSettingPanel_Inputed;
        }
Example #8
0
        public ItemListComponent(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.gameHost        = gameHost;
            this.resourceManager = resourceManager;
            this.sound           = sound;
            PictureObject back;

            waitSprite = new SpriteObject(device)
            {
                Hidden = true
            };
            this.AddChild(waitSprite);
            waitSprite.AddChild(new TextureString(device, Utility.Language["LoadingItems"], 20, true, PPDColors.White)
            {
                Position = new Vector2(400, 220)
            });
            waitSprite.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            });

            this.AddChild(stackObject = new StackObject(device,
                                                        new PictureObject(device, resourceManager, Utility.Path.Combine("delta.png")),
                                                        new TextureString(device, String.Format(":{0}", Utility.Language["CancelUsingItem"]), 15, PPDColors.White)
                                                        )
            {
                IsHorizontal = true
            });
            stackObject.Update();
            stackObject.Position = new Vector2(760 - stackObject.Width, 50);
            rectangle            = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                Hidden          = true,
                RectangleWidth  = 700,
                RectangleHeight = ItemHeight
            };
            this.AddChild(rectangle);
            mainSprite = new SpriteObject(device)
            {
                Position = new Vector2(50, SpriteY),
                Clip     = new ClipInfo(gameHost)
                {
                    PositionX = 40,
                    PositionY = ClipY,
                    Width     = 750,
                    Height    = ClipHeight
                }
            };
            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.80f
            });
            back.AddChild(new TextureString(device, Utility.Language["ItemList"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });

            Inputed    += ItemComponent_Inputed;
            GotFocused += ItemComponent_GotFocused;
        }
Example #9
0
        public PlayRecord(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.sound           = sound;
            this.resourceManager = resourceManager;

            graphNameStrings = new string[] { Utility.Language["Score"], "Cool", "Good", "Safe", "Sad", "Worst", "MaxCombo", Utility.Language["FinishTime"] };

            back = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "back.png"));
            back.AddChild(new TextureString(device, Utility.Language["PlayRecord"], 20, PPDColors.White)
            {
                Position = new Vector2(30, 28)
            });
            top = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "recordtop.png"))
            {
                Position = new Vector2(440, 70)
            };
            top.AddChild(new TextureString(device, Utility.Language["Difficulty"], 14, true, PPDColors.White)
            {
                Position = new Vector2(33, 4)
            });
            top.AddChild(new TextureString(device, Utility.Language["Score"], 14, true, PPDColors.White)
            {
                Position = new Vector2(105, 4)
            });
            top.AddChild(new TextureString(device, Utility.Language["Result"], 14, true, PPDColors.White)
            {
                Position = new Vector2(181, 4)
            });
            top.AddChild(new TextureString(device, Utility.Language["PlayDate"], 14, true, PPDColors.White)
            {
                Position = new Vector2(269, 4)
            });
            bottom = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "recordbottom.png"))
            {
                Position = new Vector2(440, 364)
            };
            triangle = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "triangle.png"), true)
            {
                Position = new Vector2(300, 410),
                Hidden   = true
            };
            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            };
            cursor = new EffectObject(device, resourceManager, Utility.Path.Combine("playrecord", "cursor.etd"))
            {
                PlayType = Effect2D.EffectManager.PlayType.ReverseLoop
            };
            cursor.Play();

            cool = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(510, 369)
            };
            good = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(510, 388)
            };
            safe = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(510, 409)
            };
            sad = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(705, 369)
            };
            worst = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(705, 388)
            };
            maxCombo = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(705, 409)
            };

            songname = new TextureString(device, "", 20, PPDColors.White)
            {
                Position = new Vector2(250, 30)
            };

            difficulty          = new TextureString(device, "Easy", 20, PPDColors.White);
            difficulty.Position = new Vector2(240 - difficulty.Width / 2, 80 - difficulty.CharacterHeight / 2);

            gd = new GraphDrawer(device, resourceManager)
            {
                Position           = new Vector2(30, 120),
                GraphWidth         = 390,
                Name               = Utility.Language["Score"],
                NamePositionCenter = new Vector2(220, 285)
            };

            sprite = new SpriteObject(device)
            {
                Position = new Vector2(440, 98)
            };

            rectangle = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                RectangleWidth  = 314,
                RectangleHeight = 16,
                BorderThickness = 2
            };

            Inputed    += PlayRecord_Inputed;
            GotFocused += PlayRecord_GotFocused;

            this.AddChild(cursor);
            this.AddChild(gd);
            this.AddChild(difficulty);
            this.AddChild(songname);
            this.AddChild(cool);
            this.AddChild(good);
            this.AddChild(safe);
            this.AddChild(sad);
            this.AddChild(worst);
            this.AddChild(maxCombo);
            this.AddChild(triangle);
            this.AddChild(top);
            this.AddChild(bottom);
            this.AddChild(rectangle);
            this.AddChild(sprite);
            this.AddChild(back);
            this.AddChild(black);
        }