Example #1
0
        public static void Reload()
        {
            if (instance != null)
            {
                instance.Close();
                instance = null;
            }

            instance = new MPTimerWindow();
        }
Example #2
0
        /// <summary>
        /// Load
        /// </summary>
        /// <param name="sender">イベント発生元</param>
        /// <param name="e">イベント引数</param>
        private void ConfigPanel_Load(object sender, EventArgs e)
        {
            this.TargetJobComboBox.DataSource    = Job.GetJobList();
            this.TargetJobComboBox.ValueMember   = "JobId";
            this.TargetJobComboBox.DisplayMember = "JobName";

            this.LoadSettings();

            this.TekiyoButton.Click += (s1, e1) =>
            {
                Settings.Default.OverlayTop  = (int)this.MPTimerWindow.Top;
                Settings.Default.OverlayLeft = (int)this.MPTimerWindow.Left;
                this.SaveSettings();

                this.MPTimerWindow.Close();
                this.MPTimerWindow = new MPTimerWindow();
                if (Settings.Default.ClickThrough)
                {
                    this.MPTimerWindow.ToTransparentWindow();
                }

                this.MPTimerWindow.Show();
            };

            this.ShokikaButton.Click += (s1, e1) =>
            {
                Settings.Default.Reset();
                Settings.Default.Save();

                this.MPTimerWindow.Top  = Settings.Default.OverlayTop;
                this.MPTimerWindow.Left = Settings.Default.OverlayLeft;

                this.LoadSettings();

                this.MPTimerWindow.Close();
                this.MPTimerWindow = new MPTimerWindow();
                if (Settings.Default.ClickThrough)
                {
                    this.MPTimerWindow.ToTransparentWindow();
                }

                this.MPTimerWindow.Show();
            };
        }
Example #3
0
        /// <summary>
        /// プラグインを初期化する
        /// </summary>
        /// <param name="pluginScreenSpace"></param>
        /// <param name="pluginStatusText"></param>
        void IActPluginV1.InitPlugin(
            TabPage pluginScreenSpace,
            Label pluginStatusText)
        {
            try
            {
                pluginScreenSpace.Text = "MPTimer";

                // アップデートを確認する
                this.Update();

                // FF14監視スレッドを開始する
                FF14Watcher.Initialize();

                // MP回復タイミングFormを表示する
                this.MPTimerWindow = new MPTimerWindow();
                this.MPTimerWindow.Show();
                if (Settings.Default.ClickThrough)
                {
                    this.MPTimerWindow.ToTransparentWindow();
                }

                // 設定Panelを追加する
                var panel = new ConfigPanel();
                panel.MPTimerWindow = this.MPTimerWindow;
                panel.Dock          = DockStyle.Fill;
                pluginScreenSpace.Controls.Add(panel);

                this.PluginStatusLabel      = pluginStatusText;
                this.PluginStatusLabel.Text = "Plugin Started";
            }
            catch (Exception ex)
            {
                ActGlobals.oFormActMain.WriteExceptionLog(
                    ex,
                    "ACT.MPTimer プラグインの初期化で例外が発生しました。");
            }
        }
Example #4
0
        /// <summary>
        /// Load
        /// </summary>
        /// <param name="sender">イベント発生元</param>
        /// <param name="e">イベント引数</param>
        private void ConfigPanel_Load(object sender, EventArgs e)
        {
            this.TargetJobComboBox.DataSource    = Job.GetJobList();
            this.TargetJobComboBox.ValueMember   = "JobId";
            this.TargetJobComboBox.DisplayMember = "JobName";

            this.LoadSettings();

            this.TekiyoButton.Click += (s1, e1) =>
            {
                try
                {
                    FF14Watcher.Deinitialize();

                    Settings.Default.OverlayTop          = (int)MPTimerWindow.Default.Top;
                    Settings.Default.OverlayLeft         = (int)MPTimerWindow.Default.Left;
                    Settings.Default.EnochianOverlayTop  = (int)EnochianTimerWindow.Default.Top;
                    Settings.Default.EnochianOverlayLeft = (int)EnochianTimerWindow.Default.Left;

                    this.SaveSettings();

                    FF14Watcher.Default.UpdateTargetJobId();

                    MPTimerWindow.Reload();
                    MPTimerWindow.Default.Show();
                    EnochianTimerWindow.Reload();
                    EnochianTimerWindow.Default.Show();

                    Trace.WriteLine("Change settings.");
                }
                finally
                {
                    FF14Watcher.Initialize();
                }
            };

            this.ShokikaButton.Click += (s1, e1) =>
            {
                try
                {
                    FF14Watcher.Deinitialize();

                    Settings.Default.Reset();
                    Settings.Default.Save();

                    MPTimerWindow.Default.Top        = Settings.Default.OverlayTop;
                    MPTimerWindow.Default.Left       = Settings.Default.OverlayLeft;
                    EnochianTimerWindow.Default.Top  = Settings.Default.EnochianOverlayTop;
                    EnochianTimerWindow.Default.Left = Settings.Default.EnochianOverlayLeft;

                    this.LoadSettings();

                    FF14Watcher.Default.UpdateTargetJobId();

                    MPTimerWindow.Reload();
                    MPTimerWindow.Default.Show();
                    EnochianTimerWindow.Reload();
                    EnochianTimerWindow.Default.Show();

                    Trace.WriteLine("Reset settings.");
                }
                finally
                {
                    FF14Watcher.Initialize();
                }
            };

            this.ProgressBarShiftColorButton.Click += (s1, e1) =>
            {
                var button = s1 as Button;
                this.colorDialog.Color = button.BackColor;
                if (this.colorDialog.ShowDialog(this.ParentForm) == DialogResult.OK)
                {
                    button.BackColor = this.colorDialog.Color;
                }
            };

            this.ProgressBarShiftOutlineColorButton.Click += (s1, e1) =>
            {
                var button = s1 as Button;
                this.colorDialog.Color = button.BackColor;
                if (this.colorDialog.ShowDialog(this.ParentForm) == DialogResult.OK)
                {
                    button.BackColor = this.colorDialog.Color;
                }
            };

            this.EnochianBarShiftColorButton.Click += (s1, e1) =>
            {
                var button = s1 as Button;
                this.colorDialog.Color = button.BackColor;
                if (this.colorDialog.ShowDialog(this.ParentForm) == DialogResult.OK)
                {
                    button.BackColor = this.colorDialog.Color;
                }
            };

            this.EnochianBarShiftOutlineColorButton.Click += (s1, e1) =>
            {
                var button = s1 as Button;
                this.colorDialog.Color = button.BackColor;
                if (this.colorDialog.ShowDialog(this.ParentForm) == DialogResult.OK)
                {
                    button.BackColor = this.colorDialog.Color;
                }
            };

            this.OverlayLocationXNumericUpDown.DataBindings.Add(
                new Binding("Value", MPTimerWindow.Default.ViewModel, "Left", false, DataSourceUpdateMode.OnPropertyChanged));
            this.OverlayLocationYNumericUpDown.DataBindings.Add(
                new Binding("Value", MPTimerWindow.Default.ViewModel, "Top", false, DataSourceUpdateMode.OnPropertyChanged));
            this.EnochianXNumericUpDown.DataBindings.Add(
                new Binding("Value", EnochianTimerWindow.Default.ViewModel, "Left", false, DataSourceUpdateMode.OnPropertyChanged));
            this.EnochianYNumericUpDown.DataBindings.Add(
                new Binding("Value", EnochianTimerWindow.Default.ViewModel, "Top", false, DataSourceUpdateMode.OnPropertyChanged));
        }