Ejemplo n.º 1
0
        /// <summary>
        /// Constructeur par défaut
        /// </summary>
        public MainForm()
        {
            InitializeComponent();
            _Instance = this;

            // Titre
            Text = _TITLE_MAIN_FORM;

            // EVO_73: Debug mode notify
            if (bool.Parse(Program.ApplicationSettings.DebugModeEnabled))
            {
                Text += _TITLE_BRIBE_DEBUG;
            }

            // EVO_40 : lancement automatique d'un module
            try
            {
                string moduleName = Program.ApplicationSettings.StartupModule;

                if (StartupModuleList.Contains(moduleName))
                {
                    ModuleType moduleType = (ModuleType)Enum.Parse(typeof(ModuleType), moduleName);

                    LoadTool(moduleType, null);
                }
            }
            catch (Exception ex)
            {
                // Exception silencieuse
                Exception2.PrintStackTrace(new Exception("Unable to launch startup module.", ex));
            }

            // EVO_36 : initialisation des configurations de lancement
            string launchConfigurationsValue = Program.ApplicationSettings.TduLaunchConfigurations;

            if (string.IsNullOrEmpty(launchConfigurationsValue))
            {
                Collection <LaunchConfiguration> launchConfigs = new Collection <LaunchConfiguration>();
                LaunchConfiguration launchConfig = new LaunchConfiguration
                {
                    Default = true,
                    Name    = _LAUNCH_CONFIG_DEFAULT_NAME
                };

                launchConfigs.Add(launchConfig);

                Program.ApplicationSettings.TduLaunchConfigurations = LaunchConfigurationConverter.ConvertToString(launchConfigs);
                Program.ApplicationSettings.Save();
            }

            // View mode
            _isBasicView = !bool.Parse(Program.ApplicationSettings.AdvancedMode);
            _SetView();
        }
Ejemplo n.º 2
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            TduModdingToolsSettings currentSettings = Program.ApplicationSettings;

            try
            {
                // Sauvegarde des données
                Cursor = Cursors.WaitCursor;

                // Main
                currentSettings.TduMainFolder = rootTextBox.Text;
                currentSettings.StartupModule = (moduleList.SelectedItem == null ? "" : moduleList.SelectedItem.ToString());
                currentSettings.TduLanguage   = (languageList.SelectedItem == null ? "" : languageList.SelectedItem.ToString());
                // EVO_73: debug mode
                currentSettings.DebugModeEnabled = (debugModeCheckBox.Checked.ToString());

                // File Editing
                // EVO_102
                if (editNewFilesFolderCurrentRadioButton.Checked)
                {
                    currentSettings.DefaultEditNewFilesFolder = "";
                }
                else
                {
                    currentSettings.DefaultEditNewFilesFolder = editFolderNewFilesTextBox.Text;
                }
                // EVO_136: display files in explorer after extract
                currentSettings.ExtractDisplayInExplorer = (editExtractShowFilesCheckBox.Checked.ToString());

                // Launch Configuration
                // Ensures current configuration has been saved
                saveConfigButton_Click(this, new EventArgs());
                currentSettings.TduLaunchConfigurations = (LaunchConfigurationConverter.ConvertToString(_TemporaryConfigList));

                // Patch Editor
                currentSettings.PatchEditorReportAutoScroll = (reportAutoScrollCheckBox.Checked.ToString());
                // EVO_110
                currentSettings.PatchEditorReportClear = (reportClearingCheckBox.Checked.ToString());

                // [EVO_172] Track Pack
                currentSettings.PlayerProfile = profilesComboBox.Text;

                currentSettings.Save();

                Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBoxes.ShowError(this, ex);
            }

            Close();
        }