コード例 #1
0
        /// <summary>
        /// プラグインを初期化する
        /// </summary>
        /// <param name="pluginScreenSpace"></param>
        /// <param name="pluginStatusText"></param>
        void IActPluginV1.InitPlugin(
            TabPage pluginScreenSpace,
            Label pluginStatusText)
        {
            try
            {
                TraceUtility.Initialize();
                Trace.WriteLine("InitPlugin begin.");

                pluginScreenSpace.Text = "MPTimer";

                // 設定Panelを追加する
                pluginScreenSpace.Controls.Add(ConfigPanel.Default);

                // アップデートを確認する
                Task.Run(() =>
                {
                    this.Update();
                });

                // オーバーレイを表示する
                MPTimerWindow.Default.Show();
                EnochianTimerWindow.Default.Show();

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

                this.PluginStatusLabel      = pluginStatusText;
                this.PluginStatusLabel.Text = "Plugin Started";
            }
            catch (Exception ex)
            {
                Trace.WriteLine(
                    "ACT.MPTimer 플러그인 초기화 도중 에러가 발생했습니다." + Environment.NewLine +
                    ex.ToString());
            }
            finally
            {
                Trace.WriteLine("InitPlugin end.");
            }
        }
コード例 #2
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 プラグインの初期化で例外が発生しました。");
            }
        }
コード例 #3
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));
        }