Exemple #1
0
        void ReplayListComponent_Inputed(IFocusable sender, InputEventArgs args)
        {
            if (!waitSprite.Hidden)
            {
                return;
            }

            if (args.InputInfo.IsPressed(ButtonType.Cross))
            {
                sound.Play(PPDSetting.DefaultSounds[2], -1000);
                FocusManager.RemoveFocus();
            }
            else if (args.InputInfo.IsPressed(ButtonType.Circle))
            {
                if (mainSprite.ChildrenCount > 0)
                {
                    sound.Play(PPDSetting.DefaultSounds[1], -1000);
                    if (SelectedComponent.SongInfo == null)
                    {
                        var obd = new OpenBrowserDialog(device, resourceManager, sound)
                        {
                            ScoreLibraryId = SelectedComponent.WebSongInfo.Hash
                        };
                        obd.LostFocused += obd_LostFocused;
                        this.InsertChild(obd, 0);
                        FocusManager.Focus(obd);
                    }
                    else
                    {
                        var gd = new GeneralDialog(device, resourceManager, sound, Utility.Language["ReplayConfirm"], GeneralDialog.ButtonTypes.OkCancel);
                        gd.LostFocused += gd_LostFocused;
                        this.InsertChild(gd, 0);
                        FocusManager.Focus(gd);
                    }
                }
            }
            else if (args.InputInfo.IsPressed(ButtonType.Down))
            {
                if (mainSprite.ChildrenCount > 0)
                {
                    selection++;
                    if (selection >= mainSprite.ChildrenCount)
                    {
                        selection = 0;
                    }
                    sound.Play(PPDSetting.DefaultSounds[0], -1000);
                }
            }
            else if (args.InputInfo.IsPressed(ButtonType.Up))
            {
                if (mainSprite.ChildrenCount > 0)
                {
                    selection--;
                    if (selection < 0)
                    {
                        selection = mainSprite.ChildrenCount - 1;
                    }
                    sound.Play(PPDSetting.DefaultSounds[0], -1000);
                }
            }
        }
Exemple #2
0
        public override bool Load()
        {
            WebManager.Instance.UpdateAccountInfo();
            //init
            var         list             = SongInformation.All;
            int         selectnum        = 0;
            string      initialdirectory = PPDSetting.Setting.SongDir;
            ContestInfo contestInfo      = null;

            WebSongInformation[] activeScores = null;
            ListInfo[]           lists        = null;
            Action[]             actions      =
            {
                () => { contestInfo  = WebManager.Instance.GetContestInfo(); },
                () => { activeScores = WebManager.Instance.GetScores(true);  },
                () => { lists        = WebManager.Instance.GetListInfos();   },
                PerfectTrialCache.Instance.Update
            };
            Parallel.ForEach(actions, (action) => action());
            // 前のメニューからのパラメーターを調べる
            if (PreviousParam.TryGetValue("PPDGameUtility", out object temp))
            {
                var gameutility = temp as PPDGameUtility;
                initialdirectory = gameutility.SongInformation.ParentDirectory;
            }
            ssm                   = new SelectSongManager(contestInfo, activeScores, lists);
            ssm.SongChanged      += ssm_SongChanged;
            ssm.DirectoryChanged += ssm_DirectoryChanged;
            ssm.ModeChanged      += ssm_ModeChanged;
            ssm.Filter.Desc       = SkinSetting.Setting.Desc;
            ssm.Filter.Difficulty = SkinSetting.Setting.Difficulty;
            ssm.Filter.Field      = SkinSetting.Setting.SortField;
            ssm.Filter.Type       = SkinSetting.Setting.ScoreType;
            textBox               = new DxTextBox(device, GameHost, ResourceManager);
            mss                   = new MenuSelectSong(device, ResourceManager, this);
            mss.Inputed          += mss_Inputed;
            mss.GotFocused       += mss_GotFocused;
            sic                   = new SongInfoControl(device, ResourceManager);
            sic.Inputed          += sic_Inputed;
            cc                 = new ConfirmControl(device, ResourceManager);
            cc.Inputed        += cc_Inputed;
            oc                 = new OptionControl(device, ResourceManager, Sound);
            lm                 = new LeftMenu(device, GameHost, ResourceManager, textBox, ssm, Sound);
            lm.RandomSelected += lm_RandomSelected;
            lm.FilterChanged  += lm_FilterChanged;
            ss                 = new ScoreSearcher(device, ResourceManager, textBox, ssm.Filter);
            obd                = new OpenBrowserDialog(device, ResourceManager, Sound);
            fm                 = new FocusManager(this);
            fm.Focus(mss);

            mss.DisapperFinish += cc.Show;
            bgd   = new BackGroundDisplay(device, ResourceManager, "skins\\PPDSingle_BackGround.xml", "Menu");
            black = new RectangleComponent(device, ResourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0
            };

            menuMovie = new MenuMovie(device);
            this.AddChild(black);
            this.AddChild(textBox);
            this.AddChild(obd);
            this.AddChild(cc);
            this.AddChild(oc);
            this.AddChild(ss);
            this.AddChild(lm);
            this.AddChild(sic);
            this.AddChild(mss);
            var po = new PictureObject(device, ResourceManager, Utility.Path.Combine("bottom.png"));

            po.Position = new Vector2(0, 450 - po.Height + 1);
            po.AddChild(new TextureString(device, Utility.Language["SearchScore"], 14, PPDColors.Gray)
            {
                Position = new Vector2(85, 7)
            });
            po.AddChild(new TextureString(device, Utility.Language["Move"], 14, PPDColors.Gray)
            {
                Position = new Vector2(205, 7)
            });
            po.AddChild(new TextureString(device, Utility.Language["Menu"], 14, PPDColors.Gray)
            {
                Position = new Vector2(325, 7)
            });
            po.AddChild(new TextureString(device, Utility.Language["Option"], 14, PPDColors.Gray)
            {
                Position = new Vector2(445, 7)
            });
            po.AddChild(new TextureString(device, Utility.Language["Decide"], 14, PPDColors.Gray)
            {
                Position = new Vector2(565, 7)
            });
            po.AddChild(new TextureString(device, Utility.Language["Back"], 14, PPDColors.Gray)
            {
                Position = new Vector2(685, 7)
            });
            this.AddChild(po);
            this.AddChild(menuMovie);
            this.AddChild(bgd);

            oc.Connect    = SkinSetting.Setting.Connect;
            oc.RivalGhost = SkinSetting.Setting.RivalGhost;

            ssm.CurrentRoot      = SongInformation.Root;
            ssm.CurrentLogicRoot = LogicFolderInfomation.Root;

            if (PreviousParam.TryGetValue("CurrentRoot", out temp))
            {
                var root = temp as SongInformation;
                ssm.CurrentRoot = root;
            }
            if (PreviousParam.TryGetValue("CurrentLogicRoot", out temp))
            {
                var root = temp as LogicFolderInfomation;
                ssm.CurrentLogicRoot = root;
            }
            if (PreviousParam.TryGetValue("CurrentMode", out temp))
            {
                var mode = (SelectSongManager.Mode)temp;
                ssm.ChangeMode(mode);
            }
            if (PreviousParam.TryGetValue("SelectedIndex", out temp))
            {
                selectnum = (int)temp;
            }
            ssm.SelectedIndex = selectnum;

            return(true);
        }