Exemplo n.º 1
0
        int timerWindowSecond;                  //毎秒行う処理のために秒数を記憶
        // コンストラクタ
        public MainWindow()
        {
            InitializeComponent();
            MouseLeftButtonDown += (o, e) => DragMove();
            // フォルダの有無をチェック
            if (!System.IO.Directory.Exists(@"pic\"))
            {
                System.IO.Directory.CreateDirectory(@"pic\");
            }
            // 画面表示を初期化
            DataContext = new MainWindowDC()
            {
                LoggingText = "",
                MenuHeaderBackgroundOther = "",
            };
            // アプリの設定を初期化
            TwitterOptionMenu.IsChecked = Properties.Settings.Default.ScreenshotForTwitterFlg;
            SetBackgroundCheck(Properties.Settings.Default.BackgroundColorType);
            ChangeLanguageCheckMenu(GetCulture());
            // 周辺クラスの初期化
            SceneRecognition.InitialSceneRecognition();
            try {
                SupplyStore.ReadMainSupply();
                addLog($"{Properties.Resources.LoggingTextReadSupplyData}:Success");
            } catch (Exception) {
                addLog($"{Properties.Resources.LoggingTextReadSupplyData}:Failed");
            }
            // タイマーを作成する
            DispatcherTimer m_Timer = new DispatcherTimer(DispatcherPriority.Normal, Dispatcher);

            m_Timer.Interval = TimeSpan.FromMilliseconds(200.0);
            m_Timer.Tick    += new EventHandler(DispatcherTimer_Tick);
            // タイマーの実行開始
            m_Timer.Start();
            timerWindowSecond = DateTime.Now.Second;
            // タイマー画面を作成・表示
            tw = new TimerWindow();
            if (Properties.Settings.Default.ShowTimerWindowFlg)
            {
                tw.Show();
            }
            // 資材記録画面を作成・表示
            sw = new SupplyWindow();
            if (Properties.Settings.Default.ShowSupplyWindowFlg)
            {
                sw.Show();
            }
        }
Exemplo n.º 2
0
        private void BackgroundOptionMenuOther_Click(object sender, RoutedEventArgs e)
        {
            SetBackgroundCheck(2);
            // ゲーム背景色を変更するため、色変更ダイアログを表示する
            var cd = new ColorDialog();

            if (cd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                // 色変更を行う
                Properties.Settings.Default.BackgroundColor = cd.Color;
                Properties.Settings.Default.Save();
                // 画面にも反映させる
                addLog($"{Properties.Resources.LoggingTextrBackground} : {MainWindowDC.ColorToString(Properties.Settings.Default.BackgroundColor)}");
                var bindData = DataContext as MainWindowDC;
                bindData.MenuHeaderBackgroundOther = "";
            }
        }