예제 #1
0
        private void Load_Click(object sender, RoutedEventArgs e)
        {
            PlayButtonSound.Play();
            var dialog = new DialogWindow.DialogWindow(
                Properties.Resources.LayoutWindowLoadTitle,
                Properties.Resources.LayoutWindowLoadMessage,
                DialogWindow.DialogWindow.DialogStyle.ORIGINAL);

            if (!vLayoutControl.LayoutFileExists(1))
            {
                dialog.Botton1.IsEnabled = false;
            }
            if (!vLayoutControl.LayoutFileExists(2))
            {
                dialog.Botton2.IsEnabled = false;
            }
            var result = dialog.ShowDialog();
            var ret    = dialog.result;

            switch (ret)
            {
            case 1:
            case 2:
                layoutDic = vLayoutControl.LoadLayout((int)ret);
                // 現在のレイアウトをいったん保存しておく
                vLayoutControl.SaveLayout(9, layoutDic);
                SetButtonLayout();
                break;

            default:
                break;
            }
        }
예제 #2
0
        private void Set_Click(object sender, RoutedEventArgs e)
        {
            PlayButtonSound.Play();
            var configWindow = (ConfigWindow)Window.GetWindow(this);

            configWindow.navigation.Navigate(new Uri(nextpage, UriKind.Relative));
        }
예제 #3
0
 private void GoForward_Click(object sender, RoutedEventArgs e)
 {
     PlayButtonSound.Play();
     if (navigation.CanGoForward)
     {
         navigation.GoForward();
     }
 }
예제 #4
0
 private void AstTime_Click(object sender, RoutedEventArgs e)
 {
     PlayButtonSound.Play();
     Properties.Settings.Default.Clock = Properties.Settings.Default.Clock ? false : true;
     AstTime.Content = Properties.Settings.Default.Clock ?
                       String.Format(Properties.Resources.ConfigButton02, check_on) :
                       String.Format(Properties.Resources.ConfigButton02, check_off);
 }
예제 #5
0
 private void Skeleton_Click(object sender, RoutedEventArgs e)
 {
     PlayButtonSound.Play();
     Properties.Settings.Default.Skeleton = Properties.Settings.Default.Skeleton ? false : true;
     Skeleton.Content = Properties.Settings.Default.Skeleton ?
                        String.Format(Properties.Resources.ConfigButton01, check_on) :
                        String.Format(Properties.Resources.ConfigButton01, check_off);
 }
예제 #6
0
 private void Barrage_Click(object sender, RoutedEventArgs e)
 {
     PlayButtonSound.Play();
     Properties.Settings.Default.Barrage = Properties.Settings.Default.Barrage ? false : true;
     Barrage.Content = Properties.Settings.Default.Barrage ?
                       String.Format(Properties.Resources.ConfigButton04, check_on) :
                       String.Format(Properties.Resources.ConfigButton04, check_off);
 }
예제 #7
0
        private void ScreenRotate_Click(object sender, RoutedEventArgs e)
        {
            PlayButtonSound.Play();
            NativeMethods.keybd_event(NativeMethods.VK_LWIN, 0, 0, (UIntPtr)0);
            byte cd = (byte)char.ConvertToUtf32("O", 0);

            NativeMethods.keybd_event(cd, 0, 0, (UIntPtr)0);
            NativeMethods.keybd_event(cd, 0, 2, (UIntPtr)0);
            NativeMethods.keybd_event(NativeMethods.VK_LWIN, 0, 2, (UIntPtr)0);
            ScreenRotate.Content = AutoRotation() ? ScreenRotate_on : ScreenRotate_off;
        }
예제 #8
0
 private void Sound_Click(object sender, RoutedEventArgs e)
 {
     if (Properties.Settings.Default.Sound)
     {
         Properties.Settings.Default.Sound = false;
         Sound.Content = sound_off;
     }
     else
     {
         Properties.Settings.Default.Sound = true;
         Sound.Content = sound_on;
     }
     PlayButtonSound.Play();
 }
예제 #9
0
        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            PlayButtonSound.Play();
            var dialog = new DialogWindow.DialogWindow(
                Properties.Resources.LayoutWindowCloseTitle,
                Properties.Resources.LayoutWindowCloseMessage,
                DialogWindow.DialogWindow.DialogStyle.OKCANCEL);
            var result = dialog.ShowDialog();

            if (result == true)
            {
                DialogResult = true;
            }
        }
예제 #10
0
        private void Reset_Click(object sender, RoutedEventArgs e)
        {
            PlayButtonSound.Play();
            var dialog = new DialogWindow.DialogWindow(
                Properties.Resources.LayoutWindowResetTitle,
                Properties.Resources.LayoutWindowResetMessage,
                DialogWindow.DialogWindow.DialogStyle.OKCANCEL);
            var result = dialog.ShowDialog();

            if (result == true)
            {
                layoutDic = vLayoutControl.LoadLayout(9);
                SetButtonLayout();
            }
        }
예제 #11
0
        public void HomeDown(object sender, vGamePadEventArgs e)
        {
            // 反転
            ChangeButtonStatus(e.ui, Colors.White, Colors.Black);

            // 音
            PlayButtonSound.Play();

            dic[e.ui.Uid].Id    = e.id;
            dic[e.ui.Uid].Range = Height;

            vGamePadBaseLeft.Background  = new SolidColorBrush(Colors.White);
            vGamePadBaseRight.Background = new SolidColorBrush(Colors.White);

            vGamePadBaseLeft.Visibility  = System.Windows.Visibility.Visible;
            vGamePadBaseRight.Visibility = System.Windows.Visibility.Visible;
        }
예제 #12
0
        public void DefaultDown(object sender, vGamePadEventArgs e)
        {
            // 反転
            ChangeButtonStatus(e.ui, Colors.White, Colors.Black);
            // 音を鳴らす
            PlayButtonSound.Play();

            dic[e.ui.Uid].Id = e.id;

            // 移動可能なコントロール
            if (dic[e.ui.Uid].Moving)
            {
                // この座標を中心点にする
                // 中心点の計算
                double width  = (double)e.ui.GetValue(WidthProperty);
                double height = (double)e.ui.GetValue(HeightProperty);
                e.ui.SetValue(Canvas.LeftProperty, e.point.X - width / 2);
                e.ui.SetValue(Canvas.TopProperty, e.point.Y - height / 2);
            }
        }
예제 #13
0
        private void BarrageTimerEvent(object sender, EventArgs e)
        {
            Debug.WriteLine("BarrageTimerEvent:{0}", ((BarrageTimer)sender).Ui.Uid);

            if (dic[((BarrageTimer)sender).Ui.Uid].Barrage == vButton.BarrageState.WaitTimeout)
            {
                // タイマーステータス TimerOn
                dic[((BarrageTimer)sender).Ui.Uid].Barrage = vButton.BarrageState.TimerOn;
                // インターバル 0.1秒
                ((BarrageTimer)sender).Interval = new TimeSpan(0, 0, 0, 0, 100);
                // 画面ボタン赤に
                ChangeButtonStatus(((BarrageTimer)sender).Ui, Colors.Red, Colors.White);
                // 音を2回鳴らす
                PlayButtonSound.Play(PlayButtonSound.PlayType.Sync);
                PlayButtonSound.Play();
            }
            // vJoyボタンダウン
            devCon.PushButton(dic[((BarrageTimer)sender).Ui.Uid].Index);
            // vJoyボタンアップ
            devCon.FreeButton(dic[((BarrageTimer)sender).Ui.Uid].Index);
        }
예제 #14
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            PlayButtonSound.Play();
            var dialog = new DialogWindow.DialogWindow(
                Properties.Resources.LayoutWindowSaveTitle,
                Properties.Resources.LayoutWindowSaveMessage,
                DialogWindow.DialogWindow.DialogStyle.ORIGINAL);
            var result = dialog.ShowDialog();
            var ret    = dialog.result;

            switch (ret)
            {
            case 1:
            case 2:
                vLayoutControl.SaveLayout((int)ret, layoutDic);
                break;

            default:
                break;
            }
        }
예제 #15
0
        private void Create_Click(object sender, RoutedEventArgs e)
        {
            PlayButtonSound.Play();
            // レイアウトモードに移行してもよいかの確認
            var dialog = new DialogWindow.DialogWindow(
                Properties.Resources.LayoutSelectTitle,
                Properties.Resources.LayoutSelectMessage,
                DialogWindow.DialogWindow.DialogStyle.OKCANCEL);
            var ret = dialog.ShowDialog();

            if (ret == true)
            {
                var configWindow = (ConfigWindow)Window.GetWindow(this);
                configWindow.ConfigGrid.Visibility = System.Windows.Visibility.Hidden;
                // レイアウト作成モードに移行
                // レイアウトモードは上にコマンドエリアを表示
                var layoutWindow = new LayoutWindow();
                layoutWindow.ShowDialog();
                configWindow.ConfigGrid.Visibility = System.Windows.Visibility.Visible;
            }
        }
예제 #16
0
 private void SetPostion_Click(object sender, RoutedEventArgs e)
 {
     PlayButtonSound.Play();
     try
     {
         Process[] ps = Process.GetProcessesByName(Properties.Resources.ProcessName);   // ドラクエ10のプロセス名を指定する
         if (ps.Length == 1)
         {
             ps[0].WaitForInputIdle();
             NativeMethods.SetWindowPos(
                 ps[0].MainWindowHandle,
                 NativeMethods.HWND_TOP,
                 System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Left,
                 System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Top,
                 0,
                 0,
                 NativeMethods.SWP_NOSIZE | NativeMethods.SWP_SHOWWINDOW);
         }
     }
     catch
     {
     }
 }
예제 #17
0
        private void Maintenance_Click(object sender, RoutedEventArgs e)
        {
            PlayButtonSound.Play();

            if (LayoutFrame.Visibility == System.Windows.Visibility.Visible)
            {
                NormalFrame.Visibility = System.Windows.Visibility.Visible;
                LayoutFrame.Visibility = System.Windows.Visibility.Collapsed;
                NormalMenu.Visibility  = System.Windows.Visibility.Visible;
                LayoutMenu.Visibility  = System.Windows.Visibility.Hidden;
            }
            else
            {
                LayoutFrame.Visibility = System.Windows.Visibility.Visible;
                NormalFrame.Visibility = System.Windows.Visibility.Collapsed;
                NormalMenu.Visibility  = System.Windows.Visibility.Hidden;
                LayoutMenu.Visibility  = System.Windows.Visibility.Visible;
                if (navigation.Content == null)
                {
                    navigation.Navigate(new Uri(nextpage, UriKind.Relative));
                }
            }
        }
예제 #18
0
        private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
        {
            PlayButtonSound.Play();

            var grid    = (Grid)sender;
            var postion = (UIElement)e.Source;

            switch (postion.Uid)
            {
            case "TopLeft":
                TopLeftDown(grid, postion);
                postion.CaptureMouse();
                break;

            case "TopRight":
                TopRightDown(grid, postion);
                postion.CaptureMouse();
                break;

            case "BottomLeft":
                BottomLeftDown(grid, postion);
                postion.CaptureMouse();
                break;

            case "BottomRight":
                BottomRightDown(grid, postion);
                postion.CaptureMouse();
                break;

            default:
                if (buttonState != null)
                {
                    buttonState.Children.RemoveRange(1, 4);
                    buttonState.SetValue(Canvas.ZIndexProperty, 0);
                }
                // すべてのボタンで同じロジックを採用する
                if (buttonState == grid)
                {
                    // 同じボタンが二回押された
                    buttonState = null;
                    break;
                }

                // 周りの4つのブロックを作成
                // 始点によって色を変える
                var   SelectedButton = layoutDic[grid.Uid];
                Color tlc            = (SelectedButton.Top != double.MaxValue && SelectedButton.Left != double.MaxValue) ? Colors.Red : Colors.White;
                Color trc            = (SelectedButton.Top != double.MaxValue && SelectedButton.Right != double.MaxValue) ? Colors.Red : Colors.White;
                Color blc            = (SelectedButton.Bottom != double.MaxValue && SelectedButton.Left != double.MaxValue) ? Colors.Red : Colors.White;
                Color brc            = (SelectedButton.Bottom != double.MaxValue && SelectedButton.Right != double.MaxValue) ? Colors.Red : Colors.White;

                topLeft     = createButton("TopLeft", System.Windows.VerticalAlignment.Top, System.Windows.HorizontalAlignment.Left, tlc);
                topRight    = createButton("TopRight", System.Windows.VerticalAlignment.Top, System.Windows.HorizontalAlignment.Right, trc);
                bottomLeft  = createButton("BottomLeft", System.Windows.VerticalAlignment.Bottom, System.Windows.HorizontalAlignment.Left, blc);
                bottomRight = createButton("BottomRight", System.Windows.VerticalAlignment.Bottom, System.Windows.HorizontalAlignment.Right, brc);
                grid.Children.Add(topLeft);
                grid.Children.Add(topRight);
                grid.Children.Add(bottomLeft);
                grid.Children.Add(bottomRight);
                grid.SetValue(Canvas.ZIndexProperty, 100);
                buttonState = grid;
                break;
            }
            e.Handled = true;
        }
예제 #19
0
 private void Exit_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     PlayButtonSound.Play();
     Close();
 }