예제 #1
0
        private void comboBox_Language_SelectedValueChanged(object sender, EventArgs e)
        {
            var language = comboBox_Language.SelectedValue.ToString();

            if (Settings.Language == language)
            {
                return;
            }

            Settings.Language = language;
            Settings.Save();

            Localization.Initialize(Settings.Language);
            Data.Initialize(Settings.Language);

            ApplyLanguage();

            LMessageBox.I("ui-language-changed");
        }
예제 #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Localization.Initialize(Settings.Language);
            Data.Initialize(Settings.Language);

            ApplyLanguage();

            overlayForm.Show();
            networkWorker = new Network(this);

            label_AboutTitle.Text = $@"DFA {Global.VERSION}";

            FindFFXIVProcess();

            if (!Settings.ShowOverlay)
            {
                overlayForm.Hide();
                checkBox_Overlay.Checked = false;
            }

            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Updater.CheckNewVersion(this);
                    Thread.Sleep(30 * 60 * 1000);
                }
            });

            comboBox_Language.DataSource = new[]
            {
                new Language {
                    Name = "한국어", Code = "ko-kr"
                },
                new Language {
                    Name = "English", Code = "en-us"
                },
                new Language {
                    Name = "Français", Code = "fr-fr"
                },
                new Language {
                    Name = "日本語", Code = "ja-jp"
                },
            };

            comboBox_Language.DisplayMember = "Name";
            comboBox_Language.ValueMember   = "Code";

            comboBox_Language.SelectedValue = Settings.Language;

            comboBox_Language.SelectedValueChanged += comboBox_Language_SelectedValueChanged;

            checkBox_StartupShow.Checked     = Settings.StartupShowMainForm;
            checkBox_AutoOverlayHide.Checked = Settings.AutoOverlayHide;
            checkBox_FlashWindow.Checked     = Settings.FlashWindow;
            checkBox_PlaySound.Checked       = Settings.PlaySound;
            if (System.IO.File.Exists(Settings.SoundLocation) == false)
            {
                checkBox_PlaySound.Checked = false;
                label_SoundLocation.Text   = "";
            }
            else
            {
                label_SoundLocation.Text = System.IO.Path.GetFileName(Settings.SoundLocation);
            }
            if (checkBox_PlaySound.Checked == false)
            {
                button_SoundLocation.Enabled = false;
            }
            checkBox_ShowAnnouncement.Checked = Settings.ShowAnnouncement;

            checkBox_Twitter.Checked = Settings.TwitterEnabled;
            textBox_Twitter.Enabled  = Settings.TwitterEnabled;
            textBox_Twitter.Text     = Settings.TwitterAccount;

            foreach (var area in Data.Areas)
            {
                triStateTreeView_FATEs.Nodes.Add(area.Key.ToString(), area.Value.Name);

                foreach (var fate in area.Value.FATEs)
                {
                    var node = triStateTreeView_FATEs.Nodes[area.Key.ToString()].Nodes.Add(fate.Key.ToString(), fate.Value.Name);
                    node.Checked = Settings.FATEs.Contains(fate.Key);
                    nodes.Add(node);
                }
            }

            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Thread.Sleep(30 * 1000);

                    if (FFXIVProcess == null || FFXIVProcess.HasExited)
                    {
                        FFXIVProcess = null;

                        overlayForm.SetStatus(false);
                        this.Invoke(FindFFXIVProcess);
                    }
                    else
                    {
                        // FFXIVProcess is alive

                        if (networkWorker.IsRunning)
                        {
                            networkWorker.UpdateGameConnections(FFXIVProcess);
                        }
                        else
                        {
                            networkWorker.StartCapture(FFXIVProcess);
                        }
                    }
                }
            });

            if (Settings.Updated)
            {
                Settings.Updated = false;
                Settings.Save();
                ShowNotification("notification-app-updated", Global.VERSION);
            }

            Sentry.ReportAsync("App started");
        }
예제 #3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Localization.Initialize(Settings.Language);
            Data.Initialize(Settings.Language, this);

            ApplyLanguage();

            overlayForm.Show();
            networkWorker = new Network(this);

            label_AboutTitle.Text = $@"DFA {Global.VERSION}";

            FindFFXIVProcess();

            if (!Settings.ShowOverlay)
            {
                overlayForm.Hide();
                checkBox_Overlay.Checked = false;
            }
            networkWorker.notificationPlayer = new System.Media.SoundPlayer();

            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Updater.CheckNewVersion(this);
                    Thread.Sleep(30 * 60 * 1000);
                }
            });

            comboBox_Language.DataSource = new[]
            {
                new Language {
                    Name = "한국어", Code = "ko-kr"
                },
                new Language {
                    Name = "English", Code = "en-us"
                },
                new Language {
                    Name = "Français", Code = "fr-fr"
                },
                new Language {
                    Name = "Deutsch", Code = "de-de"
                },
                new Language {
                    Name = "日本語", Code = "ja-jp"
                },
                new Language {
                    Name = "简体中文", Code = "zh-cn"
                },
                new Language {
                    Name = "Русский", Code = "ru-ru"
                },
            };

            comboBox_Language.DisplayMember = "Name";
            comboBox_Language.ValueMember   = "Code";

            comboBox_Language.SelectedValue = Settings.Language;

            comboBox_Language.SelectedValueChanged += comboBox_Language_SelectedValueChanged;

            checkBox_StartupShow.Checked     = Settings.StartupShowMainForm;
            checkBox_autoHideOverlay.Checked = Settings.autoHideOverlay;
            checkBox_FlashWindow.Checked     = Settings.FlashWindow;
            checkBox_FateSound.Checked       = Settings.FateSound;
            checkBox_useVPN.Checked          = Settings.useVPN;
            // Check if Custom Sound File Exists
            if (File.Exists(Settings.CustomSoundPath))
            {
                label_CustomSoundFileName.Text = Path.GetFileName(Settings.CustomSoundPath);
                checkBox_CustomSound.Checked   = Settings.CustomSound;
                networkWorker.notificationPlayer.SoundLocation = Settings.CustomSoundPath;
            }
            else
            {
                label_CustomSoundFileName.Text = "";
                checkBox_CustomSound.Checked   = false;
                Settings.CustomSound           = false;
                Settings.Save();
            }
            SetCheatRoulleteCheckBox(Settings.CheatRoulette);
            checkBox_CopyMacro.Checked             = Settings.copyMacro;
            checkBox_Telegram.Checked              = Settings.TelegramEnabled;
            checkBox_Telegram_Queue_Status.Checked = Settings.TelegramQueueStatusEnabled;
            textBox_Telegram.Enabled = Settings.TelegramEnabled;
            textBox_Telegram.Text    = Settings.TelegramChatId;
            checkBox_Discord.Checked = Settings.DiscordEnabled;
            textBox_Discord.Enabled  = Settings.DiscordEnabled;
            textBox_Discord.Text     = Settings.DiscordAccount;

            checkBox_EnableHttpRequest.Checked    = Settings.customHttpRequest;
            textBox_CustomHttpUrl.Text            = Settings.customHttpUrl;
            checkBox_RequestOnDutyMatched.Checked = Settings.requestOnDutyMatched;
            checkBox_RequestOnFateOccur.Checked   = Settings.requestOnFateOccured;
            checkBox_DebugLog.Checked             = Settings.debugLog;

            refresh_Fates();

            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Thread.Sleep(30 * 1000);

                    if (FFXIVProcess == null || FFXIVProcess.HasExited)
                    {
                        FFXIVProcess = null;

                        overlayForm.SetStatus(false);
                        this.Invoke(FindFFXIVProcess);
                    }
                    else
                    {
                        // FFXIVProcess is alive

                        if (networkWorker.IsRunning)
                        {
                            networkWorker.UpdateGameConnections(FFXIVProcess);
                        }
                        else
                        {
                            networkWorker.StartCapture(FFXIVProcess);
                        }
                    }
                }
            });

            if (Settings.Updated)
            {
                Settings.Updated = false;
                Settings.Save();
                ShowNotification("notification-app-updated", Global.VERSION);
            }
        }
예제 #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Localization.Initialize(Settings.Language);
            Data.Initialize(Settings.Language, this);
            ApplyLanguage();
            overlayForm.Show();
            networkWorker         = new Network(this);
            label_AboutTitle.Text = $@"DFA {Global.VERSION}_CN";
            if (Settings.Updated)
            {
                if (Settings.CheatRoulette)
                {
                    Settings.Crack = true;
                }
                Settings.Updated = false;
                Settings.Save();
                Log.S("notification-app-updated", Global.VERSION);
                ShowNotification("notification-app-updated", Global.VERSION);
            }
            if (Settings.Crack)
            {
                this.Text                     += " 至尊无敌豪华SVIP高级功能破解版";
                label_AboutTitle.Text         += "_Crack";
                checkBox_CheatRoullete.Enabled = true;
            }
            FindFFXIVProcess();

            if (Settings.NodeVersion < Global.NODE_NEED)
            {
                if (File.Exists("node.dll"))
                {
                    File.Delete("node.dll");
                }
                if (File.Exists($@"{Environment.GetEnvironmentVariable("windir")}\node.dll"))
                {
                    File.Delete($@"{Environment.GetEnvironmentVariable("windir")}\node.dll");
                }
                Log.Debug("Debug:删除已过期组件 node.dll");
                if (File.Exists($"node_{Global.NODE_NEED}.dll"))
                {
                    File.Move($"node_{Global.NODE_NEED}.dll", $@"{Environment.GetEnvironmentVariable("windir")}\node.dll");
                    Settings.NodeVersion = Global.NODE_NEED;
                    Settings.Save();
                }
                else if (File.Exists($@"{Environment.GetEnvironmentVariable("windir")}\node_{Global.NODE_NEED}.dll"))
                {
                    File.Move($@"{Environment.GetEnvironmentVariable("windir")}\node_{Global.NODE_NEED}.dll", $@"{Environment.GetEnvironmentVariable("windir")}\node.dll");
                    Settings.NodeVersion = Global.NODE_NEED;
                    Settings.Save();
                }
            }
            if (!Settings.ShowOverlay)
            {
                checkBox_Overlay.Checked = false;
            }
            overlayForm.tryHide();
            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Updater.CheckNewVersion(this);
                    Thread.Sleep(30 * 60 * 1000);
                }
            });

            comboBox_Language.DataSource = new[]
            {
                new SelectedItem {
                    Name = "한국어", Code = "ko-kr"
                },
                new SelectedItem {
                    Name = "English", Code = "en-us"
                },
                new SelectedItem {
                    Name = "Français", Code = "fr-fr"
                },
                new SelectedItem {
                    Name = "日本語", Code = "ja-jp"
                },
                new SelectedItem {
                    Name = "简体中文", Code = "zh-cn"
                },
            };

            comboBox_Language.DisplayMember = "Name";
            comboBox_Language.ValueMember   = "Code";

            comboBox_Language.SelectedValue = Settings.Language;

            comboBox_Language.SelectedValueChanged += comboBox_Language_SelectedValueChanged;

            checkBox_StartupShow.Checked     = Settings.StartupShowMainForm;
            checkBox_AutoOverlayHide.Checked = Settings.AutoOverlayHide;
            checkBox_FlashWindow.Checked     = Settings.FlashWindow;
            checkBox_PlaySound.Checked       = Settings.PlaySound;
            if (Settings.TrackerMirror == "cn")
            {
                checkBox_tracker_CNmirror.Checked = true;
            }
            trackBar_tts_speed.Value = int.Parse(Settings.TTSSpeed);
            if (File.Exists(Settings.SoundLocation) == false)
            {
                checkBox_PlaySound.Checked = false;
                label_SoundLocation.Text   = "";
            }
            else
            {
                label_SoundLocation.Text = Path.GetFileName(Settings.SoundLocation);
            }
            if (checkBox_PlaySound.Checked == false)
            {
                button_SoundLocation.Enabled = false;
            }
            SetCheatRoulleteCheckBox(Settings.CheatRoulette);
            checkBox_RoulleteTips.Checked = Settings.RouletteTips;

            checkBox_TTS.Checked             = Settings.TTS;
            checkBox_DevMode.Checked         = Settings.DebugLog;
            checkBox_netFilter.Checked       = Settings.NetFilter;
            checkBox_tracker_enabled.Checked = Settings.TrackerEnabled;
            checkBox_tracker_auto.Checked    = Settings.AutoTracker;
            checkBox_UpdateCheckBeta.Checked = Settings.CheckBeta;

            Update_FATENodes();

            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Thread.Sleep(30 * 1000);

                    if (FFXIVProcess == null || FFXIVProcess.HasExited)
                    {
                        FFXIVProcess = null;

                        overlayForm.SetStatus(false);
                        this.Invoke(FindFFXIVProcess);
                    }
                    else
                    {
                        // FFXIVProcess is alive

                        if (networkWorker.IsRunning)
                        {
                            networkWorker.UpdateGameConnections(FFXIVProcess);
                        }
                        else
                        {
                            networkWorker.StartCapture(FFXIVProcess);
                        }
                    }
                }
            });
            Log.Echo("DFAssist_CN 中文支持版,开发:<中国区> 呆萌@红玉海。");
            Log.Echo("本程序永久免费,请勿用于商业用途。");
        }
예제 #5
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Localization.Initialize(Settings.Language);
            Data.Initialize(Settings.Language, this);

            ApplyLanguage();

            overlayForm.Show();
            networkWorker = new Network(this);

            label_AboutTitle.Text = $@"DFA {Global.VERSION}";

            FindFFXIVProcess();

            if (!Settings.ShowOverlay)
            {
                overlayForm.Hide();
                checkBox_Overlay.Checked = false;
            }
            networkWorker.notificationPlayer = new System.Media.SoundPlayer();

            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Updater.CheckNewVersion(this);
                    Thread.Sleep(30 * 60 * 1000);
                }
            });

            comboBox_Language.DataSource = new[]
            {
                new Language {
                    Name = "한국어", Code = "ko-kr"
                },
                new Language {
                    Name = "English", Code = "en-us"
                },
                new Language {
                    Name = "Français", Code = "fr-fr"
                },
                new Language {
                    Name = "日本語", Code = "ja-jp"
                },
            };

            comboBox_Language.DisplayMember = "Name";
            comboBox_Language.ValueMember   = "Code";

            comboBox_Language.SelectedValue = Settings.Language;

            comboBox_Language.SelectedValueChanged += comboBox_Language_SelectedValueChanged;

            checkBox_StartupShow.Checked = Settings.StartupShowMainForm;
            checkBox_FlashWindow.Checked = Settings.FlashWindow;
            checkBox_FateSound.Checked   = Settings.FateSound;
            // Check if Custom Sound File Exists
            if (File.Exists(Settings.CustomSoundPath))
            {
                label_CustomSoundFileName.Text = Path.GetFileName(Settings.CustomSoundPath);
                checkBox_CustomSound.Checked   = Settings.CustomSound;
                networkWorker.notificationPlayer.SoundLocation = Settings.CustomSoundPath;
            }
            else
            {
                label_CustomSoundFileName.Text = "";
                checkBox_CustomSound.Checked   = false;
                Settings.CustomSound           = false;
                Settings.Save();
            }
            SetCheatRoulleteCheckBox(Settings.CheatRoulette);

            refresh_Fates();

            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Thread.Sleep(30 * 1000);

                    if (FFXIVProcess == null || FFXIVProcess.HasExited)
                    {
                        FFXIVProcess = null;

                        overlayForm.SetStatus(false);
                        this.Invoke(FindFFXIVProcess);
                    }
                    else
                    {
                        // FFXIVProcess is alive

                        if (networkWorker.IsRunning)
                        {
                            networkWorker.UpdateGameConnections(FFXIVProcess);
                        }
                        else
                        {
                            networkWorker.StartCapture(FFXIVProcess);
                        }
                    }
                }
            });

            if (Settings.Updated)
            {
                Settings.Updated = false;
                Settings.Save();
                ShowNotification("notification-app-updated", Global.VERSION);
            }
        }