Esempio n. 1
0
 void PlayRecord_GotFocused(IFocusable sender, FocusEventArgs args)
 {
     if (args.FocusObject is LeftMenu lm)
     {
         songname.Text           = lm.SelectedSongInformation.DirectoryName;
         songname.Position       = new Vector2(750 - songname.Width, songname.Position.Y);
         selectedSongInformation = lm.SelectedSongInformation;
         results = PPDFramework.ResultInfo.GetInfoFromSongInformation(lm.SelectedSongInformation);
         Array.Reverse(results);
         graphDrawType      = GraphDrawType.Score;
         selectedDifficulty = Difficulty.Extreme;
         int iter = 0;
         while (!CheckExist() && iter < 4)
         {
             selectedDifficulty++;
             if (selectedDifficulty >= Difficulty.Other)
             {
                 selectedDifficulty = Difficulty.Easy;
             }
             iter++;
         }
         ChangeResultTableDifficulty();
         ChangeGraphData();
         ChangeResultTable();
     }
 }
Esempio n. 2
0
 void PlayRecord_Inputed(IFocusable sender, InputEventArgs args)
 {
     if (args.InputInfo.IsPressed(ButtonType.Cross))
     {
         FocusManager.RemoveFocus();
         sound.Play(PPDSetting.DefaultSounds[2], -1000);
     }
     else if (args.InputInfo.IsPressed(ButtonType.Left))
     {
         graphDrawType--;
         if (graphDrawType < 0)
         {
             graphDrawType = GraphDrawType.FinishTime;
         }
         ChangeGraphData();
         sound.Play(PPDSetting.DefaultSounds[3], -1000);
     }
     else if (args.InputInfo.IsPressed(ButtonType.Right))
     {
         graphDrawType++;
         if (graphDrawType > GraphDrawType.FinishTime)
         {
             graphDrawType = GraphDrawType.Score;
         }
         ChangeGraphData();
         sound.Play(PPDSetting.DefaultSounds[3], -1000);
     }
     else if (args.InputInfo.IsPressed(ButtonType.R))
     {
         Difficulty last = selectedDifficulty;
         selectedDifficulty++;
         int iter = 0;
         while (!CheckExist() && iter < 4)
         {
             selectedDifficulty++;
             if (selectedDifficulty >= Difficulty.Other)
             {
                 selectedDifficulty = Difficulty.Easy;
             }
             iter++;
         }
         selectedIndex = 0;
         ChangeResultTableDifficulty();
         ChangeGraphData();
         ChangeResultTable();
         if (last != selectedDifficulty)
         {
             sound.Play(PPDSetting.DefaultSounds[3], -1000);
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.L))
     {
         Difficulty last = selectedDifficulty;
         selectedDifficulty--;
         int iter = 0;
         while (!CheckExist() && iter < 4)
         {
             selectedDifficulty--;
             if (selectedDifficulty < Difficulty.Easy)
             {
                 selectedDifficulty = Difficulty.Extreme;
             }
             iter++;
         }
         selectedIndex = 0;
         ChangeResultTableDifficulty();
         ChangeGraphData();
         ChangeResultTable();
         if (last != selectedDifficulty)
         {
             sound.Play(PPDSetting.DefaultSounds[3], -1000);
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.Up))
     {
         if (currentDifficultyRecults.Count > 0)
         {
             selectedIndex--;
             if (selectedIndex < 0)
             {
                 selectedIndex = 0;
             }
             else
             {
                 SetResultInfo();
                 sound.Play(PPDSetting.DefaultSounds[0], -1000);
             }
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.Down))
     {
         if (currentDifficultyRecults.Count > 0)
         {
             selectedIndex++;
             if (selectedIndex >= currentDifficultyRecults.Count)
             {
                 selectedIndex = currentDifficultyRecults.Count - 1;
             }
             else
             {
                 SetResultInfo();
                 sound.Play(PPDSetting.DefaultSounds[0], -1000);
             }
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.Triangle))
     {
         if (graphDrawType == GraphDrawType.FinishTime && currentDifficultyRecults.Count > 0)
         {
             var ppd = new PreviewPlayDialog(device, resourceManager, sound)
             {
                 SongName   = songname.Text,
                 Difficulty = difficultyStrings[(int)selectedDifficulty],
                 StartTime  = FloatToFloatFormatter.Formatter.Format(currentDifficultyRecults[selectedIndex].FinishTime)
             };
             FocusManager.Focus(ppd);
             this.InsertChild(ppd, 0);
             ppd.LostFocused += ppd_LostFocused;
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.Square))
     {
         if (currentDifficultyRecults.Count > 0)
         {
             var drd = new GeneralDialog(device, resourceManager, sound, Utility.Language["DeleteRecordConfirm"], GeneralDialog.ButtonTypes.OkCancel);
             FocusManager.Focus(drd);
             this.InsertChild(drd, 0);
             drd.LostFocused += drd_LostFocused;
         }
     }
 }