Пример #1
0
        public override void Load()
        {
            buttons = new Button[4];
            var names = new string[] { "RESUME", "RETRY", "REPLAY", "RETURN" };

            for (int i = 0; i < buttons.Length; i++)
            {
                buttons[i] = new Button(device, ResourceManager, pathManager, names[i])
                {
                    Position = new Vector2(400, 160 + 40 * i + 5)
                };
                buttons[i].Selected = false;
                this.AddChild(buttons[i]);
            }
            buttons[0].Selected    = true;
            buttons[2].Enabled     = false;
            latencyString          = new TextureString(device, GetLatencyString(PPDGameUtility.SongInformation.Latency), 20, PPDColors.White);
            latencyString.Position = new Vector2(400 - latencyString.Width / 2, 330);
            this.AddChild(latencyString);
            this.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("conftop.png"))
            {
                Position = new Vector2(266, 225 - 107)
            });
            this.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("confbottom.png"))
            {
                Position = new Vector2(266, 225 + 107 - 17)
            });
            this.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("confirmpause.png"))
            {
                Position = new Vector2(266, 118)
            });
            Hidden = false;
        }
Пример #2
0
        public ConfirmComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string message, string yes, string no, string ok, ConfirmButtonType buttonType) : base(device)
        {
            this.resourceManager = resourceManager;

            confirm = new TextureString(device, message, 15, 200, 400, true, true, PPDColors.White)
            {
                Position = new Vector2(300, 150)
            };
            this.AddChild(confirm);

            if (buttonType == ConfirmButtonType.YesNo)
            {
                buttons = new Button[2];
                for (int i = 0; i < buttons.Length; i++)
                {
                    buttons[i] = new Button(device, resourceManager, pathManager, i == 0 ? yes : no)
                    {
                        Position = new Vector2(i == 0 ? 350 : 450, 280)
                    };

                    buttons[i].Selected = false;
                    this.AddChild(buttons[i]);
                }
            }
            else
            {
                buttons    = new Button[1];
                buttons[0] = new Button(device, resourceManager, pathManager, ok)
                {
                    Position = new Vector2(400, 280)
                };
            }
            buttons[0].Selected = true;

            this.AddChild(new PictureObject(device, resourceManager, pathManager.Combine("conftop.png"))
            {
                Position = new Vector2(266, 225 - 107)
            });
            this.AddChild(new PictureObject(device, resourceManager, pathManager.Combine("confbottom.png"))
            {
                Position = new Vector2(266, 225 + 107 - 17)
            });
            this.AddChild(new PictureObject(device, resourceManager, pathManager.Combine("confirmpause.png"))
            {
                Position = new Vector2(266, 118)
            });
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleWidth  = 800,
                RectangleHeight = 450,
                Alpha           = 0.75f
            });

            Alpha = 1;

            Inputed += ConfirmComponent_Inputed;
        }
        public async Task <IResult <Folder> > GetFolderPageAsync(string name, string path, int pageNumber)
        {
            var relativePathResult = PathManager.Combine(path, name);

            if (!relativePathResult.IsSuccess)
            {
                return(new FailureResult <Folder>(relativePathResult.Exception));
            }

            var folderResult = FolderProvider.GetFolder(relativePathResult.Data);

            if (!folderResult.IsSuccess)
            {
                return(new FailureResult <Folder>(folderResult.Exception));
            }

            var loadPageResult = await folderResult.Data.LoadFolderPageAsync(pageNumber);

            if (!loadPageResult.IsSuccess)
            {
                return(new FailureResult <Folder>(loadPageResult.Exception));
            }

            return(new SuccessResult <Folder>(folderResult.Data));
        }
Пример #4
0
        protected override void OnInitialize()
        {
            var pathManager = new PathManager(@"img\PPD\main_game");

            contentSprite.AddChild(new NumberPictureObject(device, ResourceManager, pathManager.Combine("num.png"))
            {
                Value    = 12345,
                MaxDigit = -1
            });
        }
Пример #5
0
 protected override void OnInitialize()
 {
     var pathManager = new PathManager(@"img\PPD\main_game");
     contentSprite.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("num.png")));
     contentSprite.Clip = new ClipInfo(GameHost)
     {
         Height = 200,
         Width = 200
     };
 }
Пример #6
0
        public CheckBoxComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string text) : base(device)
        {
            this.AddChild(check = new PictureObject(device, resourceManager, pathManager.Combine("optioncheck.png"))
            {
                Position = new Vector2(0, -5),
                Scale    = new Vector2(0.5f),
                Hidden   = true
            });
            this.AddChild(checkBox = new PictureObject(device, resourceManager, pathManager.Combine("optioncheckbox.png"))
            {
                Position = new Vector2(7, 7),
                Scale    = new Vector2(0.5f),
                Alpha    = 0
            });
            TextureString str;

            this.AddChild(str = new TextureString(device, text, 20, PPDColors.White)
            {
                Position = new Vector2(30, 0)
            });
        }
Пример #7
0
        protected override void OnInitialize()
        {
            var pathManager = new PathManager(@"img\PPD\main_game");

            contentSprite.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("num.png"))
            {
                Mask = new PictureObject(device, ResourceManager, pathManager.Combine("num.png"))
                {
                    Position = new SharpDX.Vector2(10, 10)
                }
            });
            contentSprite.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("num.png"))
            {
                Position = new SharpDX.Vector2(0, 40),
                Mask     = new PictureObject(device, ResourceManager, pathManager.Combine("num.png"))
                {
                    Position = new SharpDX.Vector2(10, 10)
                },
                MaskType = PPDFramework.Shaders.MaskType.Exclude
            });
        }
Пример #8
0
 public ListBoxComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string text, params object[] items) : base(device)
 {
     if (items.Length == 1 && items[0].GetType().IsArray)
     {
         var array = (Array)items[0];
         this.items = new object[array.Length];
         for (int i = 0; i < array.Length; i++)
         {
             this.items[i] = array.GetValue(i);
         }
     }
     else
     {
         this.items = items;
     }
     this.AddChild(right = new PictureObject(device, resourceManager, pathManager.Combine("optionlistboxright.png"))
     {
         Scale = new Vector2(0.5f),
         Alpha = 0
     });
     this.AddChild(left = new PictureObject(device, resourceManager, pathManager.Combine("optionlistboxleft.png"))
     {
         Scale = new Vector2(0.5f),
         Alpha = 0
     });
     this.AddChild(str = new TextureString(device, text, 20, PPDColors.White));
     str.Update();
     this.strItems = new TextureString[this.items.Length];
     for (int i = 0; i < this.items.Length; i++)
     {
         this.AddChild(strItems[i] = new TextureString(device, this.items[i].ToString(), 20, PPDColors.White)
         {
             Hidden = true
         });
         strItems[i].Update();
     }
     left.Position = new Vector2(str.Width + 20, -5);
     AdjustPosition();
 }
Пример #9
0
        public Button(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string text) : base(device)
        {
            this.resourceManager = resourceManager;
            textureString        = new TextureString(device, text, 20, true, PPDColors.White)
            {
                Position = new Vector2(0, -10)
            };
            button = new EffectObject(device, resourceManager, pathManager.Combine("difficulty.etd"))
            {
                Alignment = EffectObject.EffectAlignment.Center,
                PlayType  = Effect2D.EffectManager.PlayType.Loop
            };
            button.Play();
            disableButton = new PictureObject(device, resourceManager, pathManager.Combine("difficulty.png"), true)
            {
                Hidden = true
            };

            this.AddChild(textureString);
            this.AddChild(button);
            this.AddChild(disableButton);
        }
Пример #10
0
        private void Add(PathManager pathManager, ColorFilterBase filter)
        {
            PictureObject temp;
            var           offset = contentSprite.ChildrenCount / 2;

            contentSprite.AddChild(new TextureString(device, filter.GetType().Name, 20, new SharpDX.Color4(1, 1, 1, 1))
            {
                Position = new SharpDX.Vector2(0, offset * 30),
            });
            contentSprite.AddChild(temp = new PictureObject(device, ResourceManager, pathManager.Combine("num.png"))
            {
                Position = new SharpDX.Vector2(400, offset * 30),
            });
            temp.ColorFilters.Add(filter);
        }
Пример #11
0
        protected override void OnInitialize()
        {
            var pathManager = new PathManager(@"img\PPD\main_game");

            contentSprite.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("num.png")));
            contentSprite.PostScreenFilters.Add(new GaussianFilter
            {
                Disperson = 16
            });
            var filter = new ColorScreenFilter();

            filter.Filters.Add(new InvertColorFilter {
                Weight = 1
            });
            this.PostScreenFilters.Add(filter);
        }
Пример #12
0
        protected override void OnInitialize()
        {
            var pathManager = new PathManager(@"img\PPD\main_game");

            foreach (var blendMode in (Effect2D.BlendMode[])Enum.GetValues(typeof(Effect2D.BlendMode)))
            {
                contentSprite.AddChild(new TextureString(device, blendMode.ToString(), 20, new SharpDX.Color4(1, 1, 1, 1))
                {
                    Position = new SharpDX.Vector2(0, ((int)blendMode) * 30),
                });
                contentSprite.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("num.png"))
                {
                    Position  = new SharpDX.Vector2(160, ((int)blendMode) * 30),
                    BlendMode = blendMode,
                });
            }
        }
        public virtual async Task <IResult <long> > GetNumOfFolderPagesAsync(string name, string path)
        {
            var relativePathResult = PathManager.Combine(path, name);

            if (!relativePathResult.IsSuccess)
            {
                return(new FailureResult <long>(relativePathResult.Exception));
            }

            var folderResult = FolderProvider.GetFolder(relativePathResult.Data);

            if (!folderResult.IsSuccess)
            {
                return(new FailureResult <long>(folderResult.Exception));
            }

            return(await folderResult.Data.GetNumOfFolderPagesAsync());
        }
        public IResult <int> GetNumberOfElementToShowOnPage(string name, string path)
        {
            var relativePathResult = PathManager.Combine(path, name);

            if (!relativePathResult.IsSuccess)
            {
                return(new FailureResult <int>(relativePathResult.Exception));
            }

            var folderResult = FolderProvider.GetFolder(relativePathResult.Data);

            if (!folderResult.IsSuccess)
            {
                return(new FailureResult <int>(folderResult.Exception));
            }

            return(new SuccessResult <int>(folderResult.Data.NumberOfElementToShowOnPage));
        }
        public IResult <SortType> GetSortType(string name, string path)
        {
            var relativePathResult = PathManager.Combine(path, name);

            if (!relativePathResult.IsSuccess)
            {
                return(new FailureResult <SortType>(relativePathResult.Exception));
            }

            var folderResult = FolderProvider.GetFolder(relativePathResult.Data);

            if (!folderResult.IsSuccess)
            {
                return(new FailureResult <SortType>(folderResult.Exception));
            }

            return(new SuccessResult <SortType>(folderResult.Data.SortType));
        }
Пример #16
0
        public ButtonComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string text) : base(device)
        {
            TextureString str;

            this.AddChild(str = new TextureString(device, text, 20, PPDColors.White)
            {
                Position = new Vector2(30, 0)
            });

            select = new EffectObject(device, resourceManager, pathManager.Combine("greenflare.etd"))
            {
                Position = new Vector2(13, 13)
            };
            select.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
            select.Play();
            select.Alignment = EffectObject.EffectAlignment.Center;
            select.Scale     = new Vector2(0.4f, 0.4f);
            this.AddChild(select);
        }
Пример #17
0
        private IResult <Void> CreateUploadFolder(IConfiguration configuration)
        {
            var createFolderResult = CreateFolderAsync(configuration.TemporaryFileFolderName, configuration.HomeFolderPath).Result;

            if (!createFolderResult.IsSuccess)
            {
                return(createFolderResult);
            }

            var uploadPathResult = PathManager.Combine(configuration.HomeFolderPath, configuration.TemporaryFileFolderName);

            if (!uploadPathResult.IsSuccess)
            {
                return(new FailureResult(uploadPathResult.Exception));
            }

            createFolderResult = CreateFolderAsync(FolderName, uploadPathResult.Data).Result;

            if (!createFolderResult.IsSuccess)
            {
                return(createFolderResult);
            }

            var pathResult = PathManager.Combine(uploadPathResult.Data, FolderName);

            if (!pathResult.IsSuccess)
            {
                return(new FailureResult(pathResult.Exception));
            }

            var uploadFolderResult = FolderProvider.GetFolder(pathResult.Data);

            if (!uploadFolderResult.IsSuccess)
            {
                return(new FailureResult(uploadFolderResult.Exception));
            }

            _uploadFolder = uploadFolderResult.Data;

            return(new SuccessResult());
        }
        public async Task <IResult <Void> > UpdateFolderMetaData(FolderMetadata folderMetadata)
        {
            var pathResult = PathManager.Combine(folderMetadata.Path, folderMetadata.Name);

            if (!pathResult.IsSuccess)
            {
                return(new FailureResult(pathResult.Exception));
            }

            var folderResult = FolderProvider.GetFolder(pathResult.Data);

            if (!folderResult.IsSuccess)
            {
                return(new FailureResult(folderResult.Exception));
            }

            folderResult.Data.SortType = folderMetadata.SortType;
            folderResult.Data.NumberOfElementToShowOnPage = folderMetadata.NumberOfPagesPerPage;

            return(await folderResult.Data.SaveAsync());
        }
Пример #19
0
 static MarkImagePaths()
 {
     if (File.Exists(@"skins\defaultskin.ini"))
     {
         var pathManager = new PathManager(@"img\PPD\main_game");
         var sr          = new StreamReader(@"skins\defaultskin.ini");
         var setting     = new SettingReader(sr.ReadToEnd());
         sr.Close();
         for (ButtonType type = ButtonType.Square; type < ButtonType.Start; type++)
         {
             colorimagepaths[(int)type] = pathManager.Combine(setting.ReadString("Color" + type));
             imagepaths[(int)type]      = pathManager.Combine(setting.ReadString(type.ToString()));
             traceimagepaths[(int)type] = pathManager.Combine(setting.ReadString("Trace" + type));
         }
         colorimagepaths[(int)ButtonType.Start]                 = pathManager.Combine(setting["ColorSliderRight"]);
         colorimagepaths[(int)ButtonType.Start + 1]             = pathManager.Combine(setting["ColorSliderLeft"]);
         colorimagepaths[(int)ButtonType.Start + 2]             = pathManager.Combine(setting["ColorSliderRightExtra"]);
         colorimagepaths[(int)ButtonType.Start + 3]             = pathManager.Combine(setting["ColorSliderLeftExtra"]);
         imagepaths[(int)ButtonType.Start]                      = pathManager.Combine(setting["SliderRight"]);
         imagepaths[(int)ButtonType.Start + 1]                  = pathManager.Combine(setting["SliderLeft"]);
         imagepaths[(int)ButtonType.Start + 2]                  = pathManager.Combine(setting["SliderRightExtra"]);
         imagepaths[(int)ButtonType.Start + 3]                  = pathManager.Combine(setting["SliderLeftExtra"]);
         traceimagepaths[(int)ButtonType.Start]                 =
             traceimagepaths[(int)ButtonType.Start + 1]         =
                 traceimagepaths[(int)ButtonType.Start + 2]     =
                     traceimagepaths[(int)ButtonType.Start + 3] = pathManager.Combine(setting["TraceSlider"]);
         longnotecirclepath = pathManager.Combine(setting.ReadString("LongNoteCirle"));
         _innerradius       = float.Parse(setting.ReadString("InnerRadius"));
         _outerradius       = float.Parse(setting.ReadString("OuterRadius"));
         axisimagepath      = pathManager.Combine(setting.ReadString("CircleAxis"));
         clockaxisimagepath = pathManager.Combine(setting.ReadString("ClockAxis"));
         for (MarkEvaluateType type = MarkEvaluateType.Cool; type <= MarkEvaluateType.Worst; type++)
         {
             effectpaths[(int)type] = pathManager.Combine(setting.ReadString("Effect" + type));
         }
         appeareffectpath = pathManager.Combine(setting.ReadString("EffectAppear"));
         slideeffectpath  = pathManager.Combine(setting.ReadString("EffectSlide"));
         holdpath         = pathManager.Combine(setting.ReadString("Hold"));
         holdx            = float.Parse(setting.ReadString("HoldX"));
         holdy            = float.Parse(setting.ReadString("HoldY"));
     }
 }