コード例 #1
0
 void PreviewPlayDialog_Inputed(IFocusable sender, InputEventArgs args)
 {
     if (args.InputInfo.IsPressed(ButtonType.Circle))
     {
         if (selection.Current == CancelIndex)
         {
             sound.Play(PPDSetting.DefaultSounds[2], -1000);
         }
         else
         {
             sound.Play(PPDSetting.DefaultSounds[1], -1000);
         }
         Result = selection.Current;
         FocusManager.RemoveFocus();
     }
     else if (args.InputInfo.IsPressed(ButtonType.Cross))
     {
         Result = -1;
         sound.Play(PPDSetting.DefaultSounds[2], -1000);
         FocusManager.RemoveFocus();
     }
     else if (args.InputInfo.IsPressed(ButtonType.Left))
     {
         buttons[selection.Current].Selected = false;
         selection.Left();
         buttons[selection.Current].Selected = true;
         sound.Play(PPDSetting.DefaultSounds[0], -1000);
     }
     else if (args.InputInfo.IsPressed(ButtonType.Right))
     {
         buttons[selection.Current].Selected = false;
         selection.Right();
         buttons[selection.Current].Selected = true;
         sound.Play(PPDSetting.DefaultSounds[0], -1000);
     }
     else if (args.InputInfo.IsPressed(ButtonType.Down) && rowCount >= 2)
     {
         buttons[selection.Current].Selected = false;
         selection.Down();
         buttons[selection.Current].Selected = true;
         sound.Play(PPDSetting.DefaultSounds[0], -1000);
     }
     else if (args.InputInfo.IsPressed(ButtonType.Up) && rowCount >= 2)
     {
         buttons[selection.Current].Selected = false;
         selection.Up();
         buttons[selection.Current].Selected = true;
         sound.Play(PPDSetting.DefaultSounds[0], -1000);
     }
 }
コード例 #2
0
ファイル: FilterControl.cs プロジェクト: KHCmaster/PPD
 void FilterControl_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.Circle))
     {
         if (CurrentSelectedComponent == setDefaultButton)
         {
             SetFlagDefault();
             sound.Play(PPDSetting.DefaultSounds[1], -1000);
         }
         else
         {
             CurrentSelectedComponent.Checked = !CurrentSelectedComponent.Checked;
             sound.Play(PPDSetting.DefaultSounds[3], -1000);
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.Down))
     {
         CurrentSelectedComponent.Selected = false;
         selection.Down();
         CurrentSelectedComponent.Selected = true;
         sound.Play(PPDSetting.DefaultSounds[0], -1000);
     }
     else if (args.InputInfo.IsPressed(ButtonType.Up))
     {
         CurrentSelectedComponent.Selected = false;
         selection.Up();
         CurrentSelectedComponent.Selected = true;
         sound.Play(PPDSetting.DefaultSounds[0], -1000);
     }
     else if (args.InputInfo.IsPressed(ButtonType.Left))
     {
         CurrentSelectedComponent.Selected = false;
         selection.Left();
         CurrentSelectedComponent.Selected = true;
         sound.Play(PPDSetting.DefaultSounds[0], -1000);
     }
     else if (args.InputInfo.IsPressed(ButtonType.Right))
     {
         CurrentSelectedComponent.Selected = false;
         selection.Right();
         CurrentSelectedComponent.Selected = true;
         sound.Play(PPDSetting.DefaultSounds[0], -1000);
     }
 }
コード例 #3
0
 void ItemSettingComponent_Inputed(IFocusable sender, InputEventArgs args)
 {
     if (args.InputInfo.IsPressed(ButtonType.Cross))
     {
         sound.Play(PPDSetting.DefaultSounds[2], -1000);
         FocusManager.RemoveFocus();
     }
     else if (args.InputInfo.IsPressed(ButtonType.Down))
     {
         if (!CurrentSelectedComponent.Down())
         {
             CurrentSelectedComponent.Selected = false;
             gridSelection.Down();
             CurrentSelectedComponent.Selected = true;
             sound.Play(PPDSetting.DefaultSounds[0], -1000);
         }
         else
         {
             sound.Play(PPDSetting.DefaultSounds[3], -1000);
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.Up))
     {
         if (!CurrentSelectedComponent.Up())
         {
             CurrentSelectedComponent.Selected = false;
             gridSelection.Up();
             CurrentSelectedComponent.Selected = true;
             sound.Play(PPDSetting.DefaultSounds[0], -1000);
         }
         else
         {
             sound.Play(PPDSetting.DefaultSounds[3], -1000);
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.Left))
     {
         if (!CurrentSelectedComponent.Left())
         {
             CurrentSelectedComponent.Selected = false;
             gridSelection.Left();
             CurrentSelectedComponent.Selected = true;
             sound.Play(PPDSetting.DefaultSounds[0], -1000);
         }
         else
         {
             sound.Play(PPDSetting.DefaultSounds[3], -1000);
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.Right))
     {
         if (!CurrentSelectedComponent.Right())
         {
             CurrentSelectedComponent.Selected = false;
             gridSelection.Right();
             CurrentSelectedComponent.Selected = true;
             sound.Play(PPDSetting.DefaultSounds[0], -1000);
         }
         else
         {
             sound.Play(PPDSetting.DefaultSounds[3], -1000);
         }
     }
     else if (args.InputInfo.IsPressed(ButtonType.Circle))
     {
         if (CurrentSelectedComponent == okButton)
         {
             SetRule();
             if (RuleChanged != null)
             {
                 RuleChanged.Invoke(this, EventArgs.Empty);
             }
             sound.Play(PPDSetting.DefaultSounds[1], -1000);
         }
         else if (CurrentSelectedComponent == cancelButton)
         {
             FocusManager.RemoveFocus();
         }
         else
         {
             CurrentSelectedComponent.Checked = !CurrentSelectedComponent.Checked;
             sound.Play(PPDSetting.DefaultSounds[3], -1000);
         }
     }
 }
コード例 #4
0
        void GameResultScore_Inputed(IFocusable sender, InputEventArgs args)
        {
            if (state == State.Done)
            {
                // カーソル移動
                if (args.InputInfo.IsPressed(ButtonType.Left))
                {
                    buttons[gridSelection.Current].Selected = false;
                    do
                    {
                        gridSelection.Left();
                    } while (!buttons[gridSelection.Current].Enabled);

                    buttons[gridSelection.Current].Selected = true;
                    Sound.Play(PPDSetting.DefaultSounds[0], -1000);
                }
                if (args.InputInfo.IsPressed(ButtonType.Right))
                {
                    buttons[gridSelection.Current].Selected = false;
                    do
                    {
                        gridSelection.Right();
                    } while (!buttons[gridSelection.Current].Enabled);
                    buttons[gridSelection.Current].Selected = true;
                    Sound.Play(PPDSetting.DefaultSounds[0], -1000);
                }
                if (args.InputInfo.IsPressed(ButtonType.Up))
                {
                    buttons[gridSelection.Current].Selected = false;
                    do
                    {
                        gridSelection.Up();
                        if (!buttons[gridSelection.Current].Enabled)
                        {
                            gridSelection.Left();
                        }
                    } while (!buttons[gridSelection.Current].Enabled);
                    buttons[gridSelection.Current].Selected = true;
                    Sound.Play(PPDSetting.DefaultSounds[0], -1000);
                }
                if (args.InputInfo.IsPressed(ButtonType.Down))
                {
                    buttons[gridSelection.Current].Selected = false;
                    do
                    {
                        gridSelection.Down();
                        if (!buttons[gridSelection.Current].Enabled)
                        {
                            gridSelection.Left();
                        }
                    } while (!buttons[gridSelection.Current].Enabled);
                    buttons[gridSelection.Current].Selected = true;
                    Sound.Play(PPDSetting.DefaultSounds[0], -1000);
                }


                // 丸だったら戻る準備
                if (args.InputInfo.IsPressed(ButtonType.Circle))
                {
                    switch (gridSelection.Current)
                    {
                    case 0:
                        FocusManager.Focus(td);
                        break;

                    case 1:
                        FocusManager.Focus(rd);
                        break;

                    case 2:
                        state = State.WaitFadeForRetry;
                        break;

                    case 3:
                        state = State.WaitFadeForReplay;
                        break;

                    case 4:
                        state = State.WaitFadeForReturn;
                        break;
                    }
                }
            }
            if ((args.InputInfo.IsPressed(ButtonType.Circle) ||
                 args.InputInfo.IsPressed(ButtonType.Left) ||
                 args.InputInfo.IsPressed(ButtonType.Right)) && state < State.Done)
            {
                state = State.Done;
                for (int i = 0; i < scoresmalls.Length; i++)
                {
                    if (i >= MarkEvals.Length)
                    {
                        scoresmalls[i].Value = (uint)MaxCombo;
                    }
                    else
                    {
                        scoresmalls[i].Value = (uint)MarkEvals[i];
                    }
                }
                scorebig.Value = (uint)Score;
                ShowAll();
            }
        }