Ejemplo n.º 1
0
        public static void Settings()
        {
            if (frmAppSettings == null)
            {
                frmAppSettings = new FrmAppSettings();
            }

            View.MainWindow.ClientFormManager.DisplayClientForm(frmAppSettings);
        }
Ejemplo n.º 2
0
        private bool ValidateFolders()
        {
            var settings = AppSettings.Default;

            var gameInstall = settings.GameInstallFolder;
            var gameOptions = settings.GameOptionsFolder;
            var journal     = settings.JournalFolder;

            var firstTimeRun = string.IsNullOrEmpty(gameInstall) &&
                               string.IsNullOrEmpty(gameOptions) &&
                               string.IsNullOrEmpty(journal);

            if (firstTimeRun)
            {
                gameInstall = GetPossibleGameInstallFolders().FirstOrDefault(Directory.Exists);
                gameOptions = GameOptionsFolder.DefaultPath;
                journal     = JournalFolder.DefaultPath;
            }

            var allValid = new GameInstallFolder(gameInstall).IsValid &&
                           new GameOptionsFolder(gameOptions).IsValid &&
                           new JournalFolder(journal).IsValid;

            if (!allValid)
            {
                MessageBox.Show(
                    Resources.MsgBox_UnableToIdentifyFolders,
                    FrmAboutBox.AssemblyTitle,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);

                using var frm = new FrmAppSettings();

                frm.txtGameInstall.Text = gameInstall;
                frm.txtGameOptions.Text = gameOptions;
                frm.txtJournal.Text     = journal;

                if (frm.ShowDialog(ContextMenu) != DialogResult.OK)
                {
                    return(false);
                }

                gameInstall = frm.txtGameInstall.Text;
                gameOptions = frm.txtGameOptions.Text;
                journal     = frm.txtJournal.Text;
            }

            settings.GameInstallFolder = gameInstall;
            settings.GameOptionsFolder = gameOptions;
            settings.JournalFolder     = journal;
            settings.Save();

            return(true);
        }
Ejemplo n.º 3
0
        private bool EditSettingsDialog(AppSettings settings)
        {
            using var frm = new FrmAppSettings();

            frm.txtGameInstall.Text = settings.GameInstallFolder;
            frm.txtGameOptions.Text = settings.GameOptionsFolder;
            frm.txtJournal.Text     = settings.JournalFolder;

            if (frm.ShowDialog(ContextMenu) != DialogResult.OK)
            {
                return(false);
            }

            settings.GameInstallFolder = frm.txtGameInstall.Text;
            settings.GameOptionsFolder = frm.txtGameOptions.Text;
            settings.JournalFolder     = frm.txtJournal.Text;

            return(true);
        }
Ejemplo n.º 4
0
        private bool EditSettingsDialog(AppSettings settings)
        {
            using var frm = new FrmAppSettings
                  {
                      GameInstallFolder       = settings.GameInstallFolder,
                      GameOptionsFolder       = settings.GameOptionsFolder,
                      JournalFolder           = settings.JournalFolder,
                      ForceEnUSKeyboardLayout = settings.ForceEnUSKeyboardLayout,
                      Colors = settings.Colors,
                  };

            if (frm.ShowDialog(ContextMenu) != DialogResult.OK)
            {
                return(false);
            }

            settings.GameInstallFolder       = frm.GameInstallFolder;
            settings.GameOptionsFolder       = frm.GameOptionsFolder;
            settings.JournalFolder           = frm.JournalFolder;
            settings.ForceEnUSKeyboardLayout = frm.ForceEnUSKeyboardLayout;

            return(true);
        }
Ejemplo n.º 5
0
        private void Settings_Click(object sender, EventArgs eventArgs)
        {
            using var frm = new FrmAppSettings();

            var settings = AppSettings.Default;

            frm.txtGameInstall.Text = settings.GameInstallFolder;
            frm.txtGameOptions.Text = settings.GameOptionsFolder;
            frm.txtJournal.Text     = settings.JournalFolder;

            if (frm.ShowDialog(ContextMenu) == DialogResult.OK)
            {
                _cc.Dispose();

                settings.GameInstallFolder = frm.txtGameInstall.Text;
                settings.GameOptionsFolder = frm.txtGameOptions.Text;
                settings.JournalFolder     = frm.txtJournal.Text;

                settings.Save();

                _cc = new ChromaController(settings.GameInstallFolder, settings.GameOptionsFolder, settings.JournalFolder);
                _cc.Start();
            }
        }