diff --git a/Fo76ini/Fo76ini.csproj b/Fo76ini/Fo76ini.csproj index 450d5c3..b989f19 100644 --- a/Fo76ini/Fo76ini.csproj +++ b/Fo76ini/Fo76ini.csproj @@ -12,6 +12,21 @@ 512 true true + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true AnyCPU @@ -187,7 +202,20 @@ + + + + False + Microsoft .NET Framework 4.7.2 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file diff --git a/Fo76ini/Fo76ini.csproj.user b/Fo76ini/Fo76ini.csproj.user new file mode 100644 index 0000000..51f6223 --- /dev/null +++ b/Fo76ini/Fo76ini.csproj.user @@ -0,0 +1,13 @@ + + + + publish\ + + + + + + en-US + false + + \ No newline at end of file diff --git a/Fo76ini/Form1.Colors.cs b/Fo76ini/Form1.Colors.cs index 91d6006..f6cf158 100644 --- a/Fo76ini/Form1.Colors.cs +++ b/Fo76ini/Form1.Colors.cs @@ -74,7 +74,7 @@ public Color PipboyColor { get { - float r = IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorR", 1.0f); + float r = IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorR", 0.1f); float g = IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorG", 1.0f); float b = IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorB", 0.5f); return Color.FromArgb( diff --git a/Fo76ini/Form1.Designer.cs b/Fo76ini/Form1.Designer.cs index d1adc87..b3f0e86 100644 --- a/Fo76ini/Form1.Designer.cs +++ b/Fo76ini/Form1.Designer.cs @@ -94,8 +94,8 @@ private void InitializeComponent() this.checkBoxQuitOnGameLaunch = new System.Windows.Forms.CheckBox(); this.checkBoxNWMode = new System.Windows.Forms.CheckBox(); this.checkBoxSkipBackupQuestion = new System.Windows.Forms.CheckBox(); - this.checkBoxIgnoreUpdates = new System.Windows.Forms.CheckBox(); this.checkBoxMultipleGameEditionsUsed = new System.Windows.Forms.CheckBox(); + this.checkBoxIgnoreUpdates = new System.Windows.Forms.CheckBox(); this.checkBoxOpenManageModsOnLaunch = new System.Windows.Forms.CheckBox(); this.buttonLaunchGame = new System.Windows.Forms.Button(); this.colorDialog = new System.Windows.Forms.ColorDialog(); @@ -188,6 +188,14 @@ private void InitializeComponent() this.buttonManageMods = new System.Windows.Forms.Button(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPageSettings = new System.Windows.Forms.TabPage(); + this.groupBoxLaunchOptions = new System.Windows.Forms.GroupBox(); + this.labelLaunchOptionTip = new System.Windows.Forms.Label(); + this.radioButtonLaunchViaExecutable = new System.Windows.Forms.RadioButton(); + this.radioButtonLaunchViaLink = new System.Windows.Forms.RadioButton(); + this.groupBoxGamePaths = new System.Windows.Forms.GroupBox(); + this.labelGamePath = new System.Windows.Forms.Label(); + this.textBoxGamePath = new System.Windows.Forms.TextBox(); + this.buttonPickGamePath = new System.Windows.Forms.Button(); this.buttonForceUpdate = new System.Windows.Forms.Button(); this.groupBoxBehavior = new System.Windows.Forms.GroupBox(); this.groupBoxLocalization = new System.Windows.Forms.GroupBox(); @@ -198,6 +206,7 @@ private void InitializeComponent() this.groupBoxOptions = new System.Windows.Forms.GroupBox(); this.buttonFixIssuesEarlierVersion = new System.Windows.Forms.Button(); this.timerCheckFiles = new System.Windows.Forms.Timer(this.components); + this.openFileDialogGamePath = new System.Windows.Forms.OpenFileDialog(); ((System.ComponentModel.ISupportInitialize)(this.numPipboyTargetWidth)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numPipboyTargetHeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numCustomResW)).BeginInit(); @@ -245,6 +254,8 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.tabControl1.SuspendLayout(); this.tabPageSettings.SuspendLayout(); + this.groupBoxLaunchOptions.SuspendLayout(); + this.groupBoxGamePaths.SuspendLayout(); this.groupBoxBehavior.SuspendLayout(); this.groupBoxLocalization.SuspendLayout(); this.groupBoxOptions.SuspendLayout(); @@ -647,7 +658,7 @@ private void InitializeComponent() this.sliderLODObjects.Location = new System.Drawing.Point(103, 41); this.sliderLODObjects.Maximum = 600; this.sliderLODObjects.Name = "sliderLODObjects"; - this.sliderLODObjects.Size = new System.Drawing.Size(209, 23); + this.sliderLODObjects.Size = new System.Drawing.Size(210, 23); this.sliderLODObjects.SmallChange = 5; this.sliderLODObjects.TabIndex = 29; this.sliderLODObjects.Text = "metroTrackBar1"; @@ -681,7 +692,7 @@ private void InitializeComponent() this.sliderLODActors.Location = new System.Drawing.Point(103, 99); this.sliderLODActors.Maximum = 600; this.sliderLODActors.Name = "sliderLODActors"; - this.sliderLODActors.Size = new System.Drawing.Size(209, 23); + this.sliderLODActors.Size = new System.Drawing.Size(210, 23); this.sliderLODActors.SmallChange = 5; this.sliderLODActors.TabIndex = 32; this.sliderLODActors.Text = "metroTrackBar3"; @@ -1087,17 +1098,6 @@ private void InitializeComponent() this.checkBoxSkipBackupQuestion.UseVisualStyleBackColor = true; this.checkBoxSkipBackupQuestion.CheckedChanged += new System.EventHandler(this.checkBoxSkipBackupQuestion_CheckedChanged); // - // checkBoxIgnoreUpdates - // - this.checkBoxIgnoreUpdates.AutoSize = true; - this.checkBoxIgnoreUpdates.Location = new System.Drawing.Point(9, 111); - this.checkBoxIgnoreUpdates.Name = "checkBoxIgnoreUpdates"; - this.checkBoxIgnoreUpdates.Size = new System.Drawing.Size(143, 17); - this.checkBoxIgnoreUpdates.TabIndex = 24; - this.checkBoxIgnoreUpdates.Text = "Don\'t check for updates."; - this.checkBoxIgnoreUpdates.UseVisualStyleBackColor = true; - this.checkBoxIgnoreUpdates.CheckedChanged += new System.EventHandler(this.checkBoxIgnoreUpdates_CheckedChanged); - // // checkBoxMultipleGameEditionsUsed // this.checkBoxMultipleGameEditionsUsed.AutoSize = true; @@ -1110,6 +1110,17 @@ private void InitializeComponent() "ndexFileList will be saved for every game edition separately."); this.checkBoxMultipleGameEditionsUsed.UseVisualStyleBackColor = true; // + // checkBoxIgnoreUpdates + // + this.checkBoxIgnoreUpdates.AutoSize = true; + this.checkBoxIgnoreUpdates.Location = new System.Drawing.Point(9, 111); + this.checkBoxIgnoreUpdates.Name = "checkBoxIgnoreUpdates"; + this.checkBoxIgnoreUpdates.Size = new System.Drawing.Size(143, 17); + this.checkBoxIgnoreUpdates.TabIndex = 24; + this.checkBoxIgnoreUpdates.Text = "Don\'t check for updates."; + this.checkBoxIgnoreUpdates.UseVisualStyleBackColor = true; + this.checkBoxIgnoreUpdates.CheckedChanged += new System.EventHandler(this.checkBoxIgnoreUpdates_CheckedChanged); + // // checkBoxOpenManageModsOnLaunch // this.checkBoxOpenManageModsOnLaunch.AutoSize = true; @@ -2085,7 +2096,7 @@ private void InitializeComponent() this.groupBoxGameEdition.Controls.Add(this.radioButtonEditionBethesdaNet); this.groupBoxGameEdition.Location = new System.Drawing.Point(6, 123); this.groupBoxGameEdition.Name = "groupBoxGameEdition"; - this.groupBoxGameEdition.Size = new System.Drawing.Size(146, 93); + this.groupBoxGameEdition.Size = new System.Drawing.Size(376, 93); this.groupBoxGameEdition.TabIndex = 12; this.groupBoxGameEdition.TabStop = false; this.groupBoxGameEdition.Text = "Game edition"; @@ -2153,7 +2164,7 @@ private void InitializeComponent() this.groupBoxUpdate.Controls.Add(this.linkLabelManualDownloadPage); this.groupBoxUpdate.Location = new System.Drawing.Point(93, 215); this.groupBoxUpdate.Name = "groupBoxUpdate"; - this.groupBoxUpdate.Size = new System.Drawing.Size(281, 94); + this.groupBoxUpdate.Size = new System.Drawing.Size(279, 94); this.groupBoxUpdate.TabIndex = 20; this.groupBoxUpdate.TabStop = false; this.groupBoxUpdate.Text = "Update available"; @@ -2175,7 +2186,7 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.buttonUpdateNow.Location = new System.Drawing.Point(9, 39); this.buttonUpdateNow.Name = "buttonUpdateNow"; - this.buttonUpdateNow.Size = new System.Drawing.Size(266, 23); + this.buttonUpdateNow.Size = new System.Drawing.Size(264, 23); this.buttonUpdateNow.TabIndex = 19; this.buttonUpdateNow.Text = "Update now!"; this.buttonUpdateNow.UseVisualStyleBackColor = true; @@ -2321,6 +2332,9 @@ private void InitializeComponent() // // tabPageSettings // + this.tabPageSettings.AutoScroll = true; + this.tabPageSettings.Controls.Add(this.groupBoxLaunchOptions); + this.tabPageSettings.Controls.Add(this.groupBoxGamePaths); this.tabPageSettings.Controls.Add(this.buttonForceUpdate); this.tabPageSettings.Controls.Add(this.groupBoxBehavior); this.tabPageSettings.Controls.Add(this.groupBoxLocalization); @@ -2335,13 +2349,105 @@ private void InitializeComponent() this.tabPageSettings.Text = "Settings"; this.tabPageSettings.UseVisualStyleBackColor = true; // + // groupBoxLaunchOptions + // + this.groupBoxLaunchOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxLaunchOptions.Controls.Add(this.labelLaunchOptionTip); + this.groupBoxLaunchOptions.Controls.Add(this.radioButtonLaunchViaExecutable); + this.groupBoxLaunchOptions.Controls.Add(this.radioButtonLaunchViaLink); + this.groupBoxLaunchOptions.Location = new System.Drawing.Point(6, 366); + this.groupBoxLaunchOptions.Name = "groupBoxLaunchOptions"; + this.groupBoxLaunchOptions.Size = new System.Drawing.Size(376, 93); + this.groupBoxLaunchOptions.TabIndex = 25; + this.groupBoxLaunchOptions.TabStop = false; + this.groupBoxLaunchOptions.Text = "Launch options"; + // + // labelLaunchOptionTip + // + this.labelLaunchOptionTip.AutoSize = true; + this.labelLaunchOptionTip.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.labelLaunchOptionTip.Location = new System.Drawing.Point(10, 67); + this.labelLaunchOptionTip.Name = "labelLaunchOptionTip"; + this.labelLaunchOptionTip.Size = new System.Drawing.Size(274, 13); + this.labelLaunchOptionTip.TabIndex = 2; + this.labelLaunchOptionTip.Text = "Tip: Enter your login credentials under the \"General\" tab."; + this.labelLaunchOptionTip.Visible = false; + // + // radioButtonLaunchViaExecutable + // + this.radioButtonLaunchViaExecutable.AutoSize = true; + this.radioButtonLaunchViaExecutable.Location = new System.Drawing.Point(10, 43); + this.radioButtonLaunchViaExecutable.Name = "radioButtonLaunchViaExecutable"; + this.radioButtonLaunchViaExecutable.Size = new System.Drawing.Size(157, 17); + this.radioButtonLaunchViaExecutable.TabIndex = 1; + this.radioButtonLaunchViaExecutable.TabStop = true; + this.radioButtonLaunchViaExecutable.Text = "Run \"Fallout76.exe\" directly"; + this.radioButtonLaunchViaExecutable.UseVisualStyleBackColor = true; + this.radioButtonLaunchViaExecutable.CheckedChanged += new System.EventHandler(this.radioButtonLaunchViaExecutable_CheckedChanged); + // + // radioButtonLaunchViaLink + // + this.radioButtonLaunchViaLink.AutoSize = true; + this.radioButtonLaunchViaLink.Location = new System.Drawing.Point(10, 20); + this.radioButtonLaunchViaLink.Name = "radioButtonLaunchViaLink"; + this.radioButtonLaunchViaLink.Size = new System.Drawing.Size(261, 17); + this.radioButtonLaunchViaLink.TabIndex = 0; + this.radioButtonLaunchViaLink.TabStop = true; + this.radioButtonLaunchViaLink.Text = "Launch via Steam / Bethesda.net (recommended)"; + this.radioButtonLaunchViaLink.UseVisualStyleBackColor = true; + // + // groupBoxGamePaths + // + this.groupBoxGamePaths.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxGamePaths.Controls.Add(this.labelGamePath); + this.groupBoxGamePaths.Controls.Add(this.textBoxGamePath); + this.groupBoxGamePaths.Controls.Add(this.buttonPickGamePath); + this.groupBoxGamePaths.Location = new System.Drawing.Point(6, 218); + this.groupBoxGamePaths.Name = "groupBoxGamePaths"; + this.groupBoxGamePaths.Size = new System.Drawing.Size(376, 45); + this.groupBoxGamePaths.TabIndex = 24; + this.groupBoxGamePaths.TabStop = false; + this.groupBoxGamePaths.Text = "Paths"; + // + // labelGamePath + // + this.labelGamePath.AutoSize = true; + this.labelGamePath.Location = new System.Drawing.Point(7, 19); + this.labelGamePath.Name = "labelGamePath"; + this.labelGamePath.Size = new System.Drawing.Size(78, 13); + this.labelGamePath.TabIndex = 17; + this.labelGamePath.Text = "Game location:"; + // + // textBoxGamePath + // + this.textBoxGamePath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxGamePath.Location = new System.Drawing.Point(111, 16); + this.textBoxGamePath.Name = "textBoxGamePath"; + this.textBoxGamePath.Size = new System.Drawing.Size(224, 20); + this.textBoxGamePath.TabIndex = 18; + this.textBoxGamePath.TextChanged += new System.EventHandler(this.textBoxGamePath_TextChanged); + // + // buttonPickGamePath + // + this.buttonPickGamePath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonPickGamePath.Location = new System.Drawing.Point(341, 14); + this.buttonPickGamePath.Name = "buttonPickGamePath"; + this.buttonPickGamePath.Size = new System.Drawing.Size(28, 23); + this.buttonPickGamePath.TabIndex = 19; + this.buttonPickGamePath.Text = "..."; + this.buttonPickGamePath.UseVisualStyleBackColor = true; + this.buttonPickGamePath.Click += new System.EventHandler(this.buttonPickGamePath_Click); + // // buttonForceUpdate // this.buttonForceUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.buttonForceUpdate.Location = new System.Drawing.Point(6, 415); + this.buttonForceUpdate.Location = new System.Drawing.Point(6, 603); this.buttonForceUpdate.Name = "buttonForceUpdate"; - this.buttonForceUpdate.Size = new System.Drawing.Size(380, 23); + this.buttonForceUpdate.Size = new System.Drawing.Size(376, 23); this.buttonForceUpdate.TabIndex = 23; this.buttonForceUpdate.Text = "Force auto-update"; this.buttonForceUpdate.UseVisualStyleBackColor = true; @@ -2349,14 +2455,16 @@ private void InitializeComponent() // // groupBoxBehavior // + this.groupBoxBehavior.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxBehavior.Controls.Add(this.checkBoxIgnoreUpdates); this.groupBoxBehavior.Controls.Add(this.checkBoxOpenManageModsOnLaunch); this.groupBoxBehavior.Controls.Add(this.checkBoxQuitOnGameLaunch); this.groupBoxBehavior.Controls.Add(this.checkBoxSkipBackupQuestion); this.groupBoxBehavior.Controls.Add(this.checkBoxAutoApply); - this.groupBoxBehavior.Location = new System.Drawing.Point(6, 222); + this.groupBoxBehavior.Location = new System.Drawing.Point(6, 465); this.groupBoxBehavior.Name = "groupBoxBehavior"; - this.groupBoxBehavior.Size = new System.Drawing.Size(380, 139); + this.groupBoxBehavior.Size = new System.Drawing.Size(376, 132); this.groupBoxBehavior.TabIndex = 22; this.groupBoxBehavior.TabStop = false; this.groupBoxBehavior.Text = "Behavior"; @@ -2371,7 +2479,7 @@ private void InitializeComponent() this.groupBoxLocalization.Controls.Add(this.comboBoxLanguage); this.groupBoxLocalization.Location = new System.Drawing.Point(6, 6); this.groupBoxLocalization.Name = "groupBoxLocalization"; - this.groupBoxLocalization.Size = new System.Drawing.Size(380, 111); + this.groupBoxLocalization.Size = new System.Drawing.Size(376, 111); this.groupBoxLocalization.TabIndex = 21; this.groupBoxLocalization.TabStop = false; this.groupBoxLocalization.Text = "Localization"; @@ -2397,11 +2505,13 @@ private void InitializeComponent() // // buttonDownloadLanguages // + this.buttonDownloadLanguages.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.buttonDownloadLanguages.Location = new System.Drawing.Point(98, 49); this.buttonDownloadLanguages.Name = "buttonDownloadLanguages"; - this.buttonDownloadLanguages.Size = new System.Drawing.Size(276, 23); + this.buttonDownloadLanguages.Size = new System.Drawing.Size(271, 23); this.buttonDownloadLanguages.TabIndex = 20; - this.buttonDownloadLanguages.Text = "Download / update languages"; + this.buttonDownloadLanguages.Text = "Download / update language files"; this.buttonDownloadLanguages.UseVisualStyleBackColor = true; this.buttonDownloadLanguages.Click += new System.EventHandler(this.buttonDownloadLanguages_Click); // @@ -2413,7 +2523,7 @@ private void InitializeComponent() this.comboBoxLanguage.FormattingEnabled = true; this.comboBoxLanguage.Location = new System.Drawing.Point(98, 22); this.comboBoxLanguage.Name = "comboBoxLanguage"; - this.comboBoxLanguage.Size = new System.Drawing.Size(276, 21); + this.comboBoxLanguage.Size = new System.Drawing.Size(271, 21); this.comboBoxLanguage.TabIndex = 17; this.comboBoxLanguage.SelectedIndexChanged += new System.EventHandler(this.comboBoxLanguage_SelectedIndexChanged); // @@ -2424,9 +2534,9 @@ private void InitializeComponent() this.groupBoxOptions.Controls.Add(this.checkBoxMultipleGameEditionsUsed); this.groupBoxOptions.Controls.Add(this.checkBoxNWMode); this.groupBoxOptions.Controls.Add(this.checkBoxReadOnly); - this.groupBoxOptions.Location = new System.Drawing.Point(158, 123); + this.groupBoxOptions.Location = new System.Drawing.Point(6, 269); this.groupBoxOptions.Name = "groupBoxOptions"; - this.groupBoxOptions.Size = new System.Drawing.Size(228, 93); + this.groupBoxOptions.Size = new System.Drawing.Size(376, 91); this.groupBoxOptions.TabIndex = 15; this.groupBoxOptions.TabStop = false; this.groupBoxOptions.Text = "Options"; @@ -2435,9 +2545,9 @@ private void InitializeComponent() // this.buttonFixIssuesEarlierVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.buttonFixIssuesEarlierVersion.Location = new System.Drawing.Point(6, 444); + this.buttonFixIssuesEarlierVersion.Location = new System.Drawing.Point(6, 632); this.buttonFixIssuesEarlierVersion.Name = "buttonFixIssuesEarlierVersion"; - this.buttonFixIssuesEarlierVersion.Size = new System.Drawing.Size(380, 23); + this.buttonFixIssuesEarlierVersion.Size = new System.Drawing.Size(376, 23); this.buttonFixIssuesEarlierVersion.TabIndex = 19; this.buttonFixIssuesEarlierVersion.Text = "Fix settings from v1.3.1 and earlier"; this.buttonFixIssuesEarlierVersion.UseVisualStyleBackColor = true; @@ -2448,6 +2558,11 @@ private void InitializeComponent() this.timerCheckFiles.Interval = 5000; this.timerCheckFiles.Tick += new System.EventHandler(this.timerCheckFiles_Tick); // + // openFileDialogGamePath + // + this.openFileDialogGamePath.FileName = "Fallout76.exe"; + this.openFileDialogGamePath.Filter = "Fallout76.exe|Fallout76.exe"; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2533,6 +2648,10 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); this.tabControl1.ResumeLayout(false); this.tabPageSettings.ResumeLayout(false); + this.groupBoxLaunchOptions.ResumeLayout(false); + this.groupBoxLaunchOptions.PerformLayout(); + this.groupBoxGamePaths.ResumeLayout(false); + this.groupBoxGamePaths.PerformLayout(); this.groupBoxBehavior.ResumeLayout(false); this.groupBoxBehavior.PerformLayout(); this.groupBoxLocalization.ResumeLayout(false); @@ -2712,6 +2831,15 @@ private void InitializeComponent() private System.Windows.Forms.RadioButton radioButtonEditionBethesdaNetPTS; private System.Windows.Forms.CheckBox checkBoxMultipleGameEditionsUsed; private System.Windows.Forms.Button buttonForceUpdate; + private System.Windows.Forms.GroupBox groupBoxGamePaths; + private System.Windows.Forms.Label labelGamePath; + private System.Windows.Forms.TextBox textBoxGamePath; + private System.Windows.Forms.Button buttonPickGamePath; + private System.Windows.Forms.GroupBox groupBoxLaunchOptions; + private System.Windows.Forms.RadioButton radioButtonLaunchViaExecutable; + private System.Windows.Forms.RadioButton radioButtonLaunchViaLink; + private System.Windows.Forms.Label labelLaunchOptionTip; + private System.Windows.Forms.OpenFileDialog openFileDialogGamePath; } } diff --git a/Fo76ini/Form1.cs b/Fo76ini/Form1.cs index 5f7b6f5..df4d143 100644 --- a/Fo76ini/Form1.cs +++ b/Fo76ini/Form1.cs @@ -15,7 +15,7 @@ namespace Fo76ini { public partial class Form1 : Form { - public const String VERSION = "1.6.1"; + public const String VERSION = "1.6.2"; protected System.Globalization.CultureInfo enUS = System.Globalization.CultureInfo.CreateSpecificCulture("en-US"); @@ -306,6 +306,14 @@ private void AddAllEventHandler() "0" ); + // Launch options + uiLoader.LinkList( + new RadioButton[] { this.radioButtonLaunchViaLink, this.radioButtonLaunchViaExecutable }, + new String[] { "1", "2" }, + IniFile.Config, "Preferences", "uLaunchOption", + "1" + ); + // Nuclear winter mode uiLoader.LinkBool(this.checkBoxNWMode, IniFile.Config, "Preferences", "bNWMode", false); @@ -808,27 +816,43 @@ private void checkBoxReadOnly_CheckedChanged(object sender, EventArgs e) private void buttonLaunchGame_Click(object sender, EventArgs e) { uint uGameEdition = IniFiles.Instance.GetUInt(IniFile.Config, "Preferences", "uGameEdition", 0); + uint uLaunchOption = IniFiles.Instance.GetUInt(IniFile.Config, "Preferences", "uLaunchOption", 1); String process = null; - switch (uGameEdition) + if (uLaunchOption == 1) + { + switch (uGameEdition) + { + case (uint)GameEdition.BethesdaNet: + process = "bethesdanet://run/20"; + break; + case (uint)GameEdition.Steam: + process = "steam://run/1151340"; // "steam://runappid/1151340" + break; + case (uint)GameEdition.BethesdaNetPTS: + process = "bethesdanet://run/57"; + break; + default: + MsgBox.Get("chooseGameEdition").Show(MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } + } + else if (uLaunchOption == 2) { - case (uint)GameEdition.BethesdaNet: - process = "bethesdanet://run/20"; - break; - case (uint)GameEdition.Steam: - process = "steam://run/1151340"; // "steam://runappid/1151340" - break; - case (uint)GameEdition.BethesdaNetPTS: - process = "bethesdanet://run/57"; - break; - default: - MsgBox.Get("chooseGameEdition").Show(MessageBoxButtons.OK, MessageBoxIcon.Information); + if (!ManagedMods.Instance.ValidateGamePath()) + { + MsgBox.Get("modsGamePathNotSet").Show(MessageBoxButtons.OK, MessageBoxIcon.Information); return; + } + process = Path.GetFullPath(Path.Combine(ManagedMods.Instance.GamePath, "Fallout76.exe")); + } + if (process != null) + { + if (IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bAutoApply", false)) + ApplyChanges(); + System.Diagnostics.Process.Start(process); + if (IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bQuitOnLaunch", false)) + this.Close(); } - if (IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bAutoApply", false)) - ApplyChanges(); - System.Diagnostics.Process.Start(process); - if (IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bQuitOnLaunch", false)) - this.Close(); } // "Get the latest version from NexusMods" link: @@ -865,6 +889,7 @@ private void buttonManageMods_Click(object sender, EventArgs e) formModsBackupCreated = true; } Utils.SetFormPosition(this.formMods, this.Location.X + this.Width, this.Location.Y); + this.formMods.UpdateUI(); this.formMods.Show(); } @@ -904,19 +929,28 @@ private void buttonFixIssuesEarlierVersion_Click(object sender, EventArgs e) private void radioButtonEditionSteam_CheckedChanged(object sender, EventArgs e) { if (this.radioButtonEditionSteam.Checked) + { this.formMods.ChangeGameEdition(GameEdition.Steam); + this.textBoxGamePath.Text = ManagedMods.Instance.GamePath; + } } private void radioButtonEditionBethesdaNet_CheckedChanged(object sender, EventArgs e) { if (this.radioButtonEditionBethesdaNet.Checked) + { this.formMods.ChangeGameEdition(GameEdition.BethesdaNet); + this.textBoxGamePath.Text = ManagedMods.Instance.GamePath; + } } private void radioButtonEditionBethesdaNetPTS_CheckedChanged(object sender, EventArgs e) { if (this.radioButtonEditionBethesdaNetPTS.Checked) + { this.formMods.ChangeGameEdition(GameEdition.BethesdaNetPTS); + this.textBoxGamePath.Text = ManagedMods.Instance.GamePath; + } } // Nuclear Winter mode @@ -1044,5 +1078,66 @@ private void checkBoxIgnoreUpdates_CheckedChanged(object sender, EventArgs e) IniFiles.Instance.Set(IniFile.Config, "Preferences", "bIgnoreUpdates", this.checkBoxIgnoreUpdates.Checked); this.CheckVersion(); } + + /* + * Game path + */ + + // Pick game path + private void buttonPickGamePath_Click(object sender, EventArgs e) + { + if (ManagedMods.Instance.isDeploymentNecessary()) + { + MsgBox.ShowID("modsDeploymentNecessary"); + return; + } + if (this.openFileDialogGamePath.ShowDialog() == DialogResult.OK) + { + String path = Path.GetDirectoryName(this.openFileDialogGamePath.FileName); // We want the path where Fallout76.exe resides. + if (Directory.Exists(Path.Combine(path, "Data"))) + { + this.textBoxGamePath.Text = path; + ManagedMods.Instance.GamePath = path; + IniFiles.Instance.Set(IniFile.Config, "Preferences", ManagedMods.Instance.GamePathKey, path); + IniFiles.Instance.SaveConfig(); + ManagedMods.Instance.Load(); + } + else + MsgBox.ShowID("modsGamePathInvalid"); + } + } + + // Game path textbox changed + private void textBoxGamePath_TextChanged(object sender, EventArgs e) + { + if (this.textBoxGamePath.Focused) + { + if (ManagedMods.Instance.isDeploymentNecessary()) + { + if (this.textBoxGamePath.Text != ManagedMods.Instance.GamePath) + this.textBoxGamePath.Text = ManagedMods.Instance.GamePath; + return; + } + else if (Directory.Exists(Path.Combine(this.textBoxGamePath.Text, "Data"))) + { + ManagedMods.Instance.GamePath = this.textBoxGamePath.Text; + IniFiles.Instance.Set(IniFile.Config, "Preferences", ManagedMods.Instance.GamePathKey, this.textBoxGamePath.Text); + IniFiles.Instance.SaveConfig(); + ManagedMods.Instance.Load(); + this.textBoxGamePath.ForeColor = Color.Black; + this.textBoxGamePath.BackColor = Color.White; + } + else + { + this.textBoxGamePath.ForeColor = Color.White; + this.textBoxGamePath.BackColor = Color.Red; + } + } + } + + private void radioButtonLaunchViaExecutable_CheckedChanged(object sender, EventArgs e) + { + this.labelLaunchOptionTip.Visible = this.radioButtonLaunchViaExecutable.Checked; + } } } diff --git a/Fo76ini/Form1.resx b/Fo76ini/Form1.resx index fa86cde..1b5c2ba 100644 --- a/Fo76ini/Form1.resx +++ b/Fo76ini/Form1.resx @@ -272,6 +272,9 @@ Affected files: Fallout76Custom.ini 221, 17 + + 864, 17 + 82 diff --git a/Fo76ini/FormMods.Designer.cs b/Fo76ini/FormMods.Designer.cs index a6f5420..09fb290 100644 --- a/Fo76ini/FormMods.Designer.cs +++ b/Fo76ini/FormMods.Designer.cs @@ -52,19 +52,10 @@ private void InitializeComponent() this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPageModOrder = new System.Windows.Forms.TabPage(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolStripButtonAddMod = new System.Windows.Forms.ToolStripButton(); - this.toolStripButtonAddModFrozen = new System.Windows.Forms.ToolStripButton(); - this.toolStripButtonAddModFolder = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButtonCheckAll = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButtonMoveUp = new System.Windows.Forms.ToolStripButton(); - this.toolStripButtonMoveDown = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButtonModEdit = new System.Windows.Forms.ToolStripButton(); - this.toolStripButtonModOpenFolder = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButtonDeleteMod = new System.Windows.Forms.ToolStripButton(); this.listViewMods = new System.Windows.Forms.ListView(); this.columnHeaderModTitle = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderInstallAs = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -75,15 +66,13 @@ private void InitializeComponent() this.columnHeaderFrozenState = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tabPageModsSettings = new System.Windows.Forms.TabPage(); this.groupBoxLists = new System.Windows.Forms.GroupBox(); + this.buttonModsResetTextboxes = new System.Windows.Forms.Button(); + this.buttonModsApplyTextBoxes = new System.Windows.Forms.Button(); this.textBoxsResourceIndexFileList = new System.Windows.Forms.TextBox(); this.buttonModsCleanLists = new System.Windows.Forms.Button(); this.labelsResourceIndexFileList = new System.Windows.Forms.Label(); this.textBoxsResourceArchive2List = new System.Windows.Forms.TextBox(); this.labelsResourceArchive2List = new System.Windows.Forms.Label(); - this.groupBoxGamePaths = new System.Windows.Forms.GroupBox(); - this.labelGamePath = new System.Windows.Forms.Label(); - this.textBoxGamePath = new System.Windows.Forms.TextBox(); - this.buttonPickGamePath = new System.Windows.Forms.Button(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.openFileDialogMod = new System.Windows.Forms.OpenFileDialog(); this.folderBrowserDialogMod = new System.Windows.Forms.FolderBrowserDialog(); @@ -91,15 +80,22 @@ private void InitializeComponent() this.openFileDialogGamePath = new System.Windows.Forms.OpenFileDialog(); this.panel1 = new System.Windows.Forms.Panel(); this.openFileDialogBA2 = new System.Windows.Forms.OpenFileDialog(); - this.buttonModsApplyTextBoxes = new System.Windows.Forms.Button(); - this.buttonModsResetTextboxes = new System.Windows.Forms.Button(); + this.toolStripButtonAddMod = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonAddModFrozen = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonAddModFolder = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonCheckAll = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonMoveUp = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonMoveDown = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonModEdit = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonModOpenFolder = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonDeleteMod = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonUnfreeze = new System.Windows.Forms.ToolStripButton(); this.menuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPageModOrder.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.tabPageModsSettings.SuspendLayout(); this.groupBoxLists.SuspendLayout(); - this.groupBoxGamePaths.SuspendLayout(); this.panel1.SuspendLayout(); this.SuspendLayout(); // @@ -303,148 +299,41 @@ private void InitializeComponent() this.toolStripButtonMoveDown, this.toolStripSeparator3, this.toolStripButtonModEdit, + this.toolStripButtonUnfreeze, this.toolStripButtonModOpenFolder, this.toolStripSeparator5, this.toolStripButtonDeleteMod}); this.toolStrip1.Location = new System.Drawing.Point(3, 3); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.toolStrip1.Size = new System.Drawing.Size(31, 438); + this.toolStrip1.Size = new System.Drawing.Size(32, 438); this.toolStrip1.TabIndex = 44; this.toolStrip1.Text = "toolStrip1"; // - // toolStripButtonAddMod - // - this.toolStripButtonAddMod.AutoSize = false; - this.toolStripButtonAddMod.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonAddMod.Image = global::Fo76ini.Properties.Resources.plus; - this.toolStripButtonAddMod.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonAddMod.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonAddMod.Name = "toolStripButtonAddMod"; - this.toolStripButtonAddMod.Size = new System.Drawing.Size(30, 30); - this.toolStripButtonAddMod.Text = "Add mod (from archive)"; - this.toolStripButtonAddMod.Click += new System.EventHandler(this.toolStripButtonAddMod_Click); - // - // toolStripButtonAddModFrozen - // - this.toolStripButtonAddModFrozen.AutoSize = false; - this.toolStripButtonAddModFrozen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonAddModFrozen.Image = global::Fo76ini.Properties.Resources.frozen_plus; - this.toolStripButtonAddModFrozen.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonAddModFrozen.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonAddModFrozen.Name = "toolStripButtonAddModFrozen"; - this.toolStripButtonAddModFrozen.Size = new System.Drawing.Size(30, 30); - this.toolStripButtonAddModFrozen.Text = "Add mod (from *.ba2 archive)"; - this.toolStripButtonAddModFrozen.Click += new System.EventHandler(this.toolStripButtonAddModFrozen_Click); - // - // toolStripButtonAddModFolder - // - this.toolStripButtonAddModFolder.AutoSize = false; - this.toolStripButtonAddModFolder.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonAddModFolder.Image = global::Fo76ini.Properties.Resources.folder_plus; - this.toolStripButtonAddModFolder.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonAddModFolder.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonAddModFolder.Name = "toolStripButtonAddModFolder"; - this.toolStripButtonAddModFolder.Size = new System.Drawing.Size(30, 30); - this.toolStripButtonAddModFolder.Text = "Add mod (from folder)"; - this.toolStripButtonAddModFolder.Click += new System.EventHandler(this.toolStripButtonAddModFolder_Click); - // // toolStripSeparator4 // this.toolStripSeparator4.Margin = new System.Windows.Forms.Padding(0, 8, 0, 8); this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new System.Drawing.Size(28, 6); // - // toolStripButtonCheckAll - // - this.toolStripButtonCheckAll.AutoSize = false; - this.toolStripButtonCheckAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonCheckAll.Image = global::Fo76ini.Properties.Resources.checkbox_checked; - this.toolStripButtonCheckAll.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonCheckAll.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonCheckAll.Name = "toolStripButtonCheckAll"; - this.toolStripButtonCheckAll.Size = new System.Drawing.Size(30, 30); - this.toolStripButtonCheckAll.Text = "Check/uncheck all"; - this.toolStripButtonCheckAll.Click += new System.EventHandler(this.toolStripButtonCheckAll_Click); - // // toolStripSeparator2 // this.toolStripSeparator2.Margin = new System.Windows.Forms.Padding(0, 8, 0, 8); this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(28, 6); // - // toolStripButtonMoveUp - // - this.toolStripButtonMoveUp.AutoSize = false; - this.toolStripButtonMoveUp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonMoveUp.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonMoveUp.Image"))); - this.toolStripButtonMoveUp.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonMoveUp.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonMoveUp.Name = "toolStripButtonMoveUp"; - this.toolStripButtonMoveUp.Size = new System.Drawing.Size(30, 30); - this.toolStripButtonMoveUp.Text = "Move up"; - this.toolStripButtonMoveUp.Click += new System.EventHandler(this.toolStripButtonMoveUp_Click); - // - // toolStripButtonMoveDown - // - this.toolStripButtonMoveDown.AutoSize = false; - this.toolStripButtonMoveDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonMoveDown.Image = global::Fo76ini.Properties.Resources.arrow_down; - this.toolStripButtonMoveDown.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonMoveDown.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonMoveDown.Name = "toolStripButtonMoveDown"; - this.toolStripButtonMoveDown.Size = new System.Drawing.Size(30, 30); - this.toolStripButtonMoveDown.Text = "Move down"; - this.toolStripButtonMoveDown.Click += new System.EventHandler(this.toolStripButtonMoveDown_Click); - // // toolStripSeparator3 // this.toolStripSeparator3.Margin = new System.Windows.Forms.Padding(0, 8, 0, 8); this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new System.Drawing.Size(28, 6); // - // toolStripButtonModEdit - // - this.toolStripButtonModEdit.AutoSize = false; - this.toolStripButtonModEdit.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonModEdit.Image = global::Fo76ini.Properties.Resources.pencil; - this.toolStripButtonModEdit.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonModEdit.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonModEdit.Name = "toolStripButtonModEdit"; - this.toolStripButtonModEdit.Size = new System.Drawing.Size(30, 30); - this.toolStripButtonModEdit.Text = "Edit mod details"; - this.toolStripButtonModEdit.Click += new System.EventHandler(this.toolStripButtonModEdit_Click); - // - // toolStripButtonModOpenFolder - // - this.toolStripButtonModOpenFolder.AutoSize = false; - this.toolStripButtonModOpenFolder.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonModOpenFolder.Image = global::Fo76ini.Properties.Resources.folder_open; - this.toolStripButtonModOpenFolder.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonModOpenFolder.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonModOpenFolder.Name = "toolStripButtonModOpenFolder"; - this.toolStripButtonModOpenFolder.Size = new System.Drawing.Size(30, 30); - this.toolStripButtonModOpenFolder.Text = "Open mod folder"; - this.toolStripButtonModOpenFolder.Click += new System.EventHandler(this.toolStripButtonModOpenFolder_Click); - // // toolStripSeparator5 // this.toolStripSeparator5.Margin = new System.Windows.Forms.Padding(0, 8, 0, 8); this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Size = new System.Drawing.Size(28, 6); // - // toolStripButtonDeleteMod - // - this.toolStripButtonDeleteMod.AutoSize = false; - this.toolStripButtonDeleteMod.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonDeleteMod.Image = global::Fo76ini.Properties.Resources.bin; - this.toolStripButtonDeleteMod.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonDeleteMod.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonDeleteMod.Name = "toolStripButtonDeleteMod"; - this.toolStripButtonDeleteMod.Size = new System.Drawing.Size(30, 30); - this.toolStripButtonDeleteMod.Text = "Delete mod"; - this.toolStripButtonDeleteMod.Click += new System.EventHandler(this.toolStripButtonDeleteMod_Click); - // // listViewMods // this.listViewMods.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -509,7 +398,6 @@ private void InitializeComponent() // tabPageModsSettings // this.tabPageModsSettings.Controls.Add(this.groupBoxLists); - this.tabPageModsSettings.Controls.Add(this.groupBoxGamePaths); this.tabPageModsSettings.Location = new System.Drawing.Point(4, 22); this.tabPageModsSettings.Name = "tabPageModsSettings"; this.tabPageModsSettings.Padding = new System.Windows.Forms.Padding(3); @@ -530,13 +418,35 @@ private void InitializeComponent() this.groupBoxLists.Controls.Add(this.labelsResourceIndexFileList); this.groupBoxLists.Controls.Add(this.textBoxsResourceArchive2List); this.groupBoxLists.Controls.Add(this.labelsResourceArchive2List); - this.groupBoxLists.Location = new System.Drawing.Point(6, 64); + this.groupBoxLists.Location = new System.Drawing.Point(6, 6); this.groupBoxLists.Name = "groupBoxLists"; - this.groupBoxLists.Size = new System.Drawing.Size(480, 374); + this.groupBoxLists.Size = new System.Drawing.Size(480, 432); this.groupBoxLists.TabIndex = 59; this.groupBoxLists.TabStop = false; this.groupBoxLists.Text = "Lists"; // + // buttonModsResetTextboxes + // + this.buttonModsResetTextboxes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonModsResetTextboxes.Location = new System.Drawing.Point(243, 403); + this.buttonModsResetTextboxes.Name = "buttonModsResetTextboxes"; + this.buttonModsResetTextboxes.Size = new System.Drawing.Size(98, 23); + this.buttonModsResetTextboxes.TabIndex = 60; + this.buttonModsResetTextboxes.Text = "Reset"; + this.buttonModsResetTextboxes.UseVisualStyleBackColor = true; + this.buttonModsResetTextboxes.Click += new System.EventHandler(this.buttonModsResetTextboxes_Click); + // + // buttonModsApplyTextBoxes + // + this.buttonModsApplyTextBoxes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonModsApplyTextBoxes.Location = new System.Drawing.Point(347, 403); + this.buttonModsApplyTextBoxes.Name = "buttonModsApplyTextBoxes"; + this.buttonModsApplyTextBoxes.Size = new System.Drawing.Size(127, 23); + this.buttonModsApplyTextBoxes.TabIndex = 59; + this.buttonModsApplyTextBoxes.Text = "Apply changes"; + this.buttonModsApplyTextBoxes.UseVisualStyleBackColor = true; + this.buttonModsApplyTextBoxes.Click += new System.EventHandler(this.buttonModsApplyTextBoxes_Click); + // // textBoxsResourceIndexFileList // this.textBoxsResourceIndexFileList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -545,13 +455,13 @@ private void InitializeComponent() this.textBoxsResourceIndexFileList.Location = new System.Drawing.Point(210, 37); this.textBoxsResourceIndexFileList.Multiline = true; this.textBoxsResourceIndexFileList.Name = "textBoxsResourceIndexFileList"; - this.textBoxsResourceIndexFileList.Size = new System.Drawing.Size(264, 302); + this.textBoxsResourceIndexFileList.Size = new System.Drawing.Size(264, 360); this.textBoxsResourceIndexFileList.TabIndex = 54; // // buttonModsCleanLists // this.buttonModsCleanLists.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonModsCleanLists.Location = new System.Drawing.Point(6, 345); + this.buttonModsCleanLists.Location = new System.Drawing.Point(6, 403); this.buttonModsCleanLists.Name = "buttonModsCleanLists"; this.buttonModsCleanLists.Size = new System.Drawing.Size(98, 23); this.buttonModsCleanLists.TabIndex = 58; @@ -575,7 +485,7 @@ private void InitializeComponent() this.textBoxsResourceArchive2List.Location = new System.Drawing.Point(6, 37); this.textBoxsResourceArchive2List.Multiline = true; this.textBoxsResourceArchive2List.Name = "textBoxsResourceArchive2List"; - this.textBoxsResourceArchive2List.Size = new System.Drawing.Size(198, 302); + this.textBoxsResourceArchive2List.Size = new System.Drawing.Size(198, 360); this.textBoxsResourceArchive2List.TabIndex = 57; // // labelsResourceArchive2List @@ -587,50 +497,6 @@ private void InitializeComponent() this.labelsResourceArchive2List.TabIndex = 56; this.labelsResourceArchive2List.Text = "sResourceArchive2List"; // - // groupBoxGamePaths - // - this.groupBoxGamePaths.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxGamePaths.Controls.Add(this.labelGamePath); - this.groupBoxGamePaths.Controls.Add(this.textBoxGamePath); - this.groupBoxGamePaths.Controls.Add(this.buttonPickGamePath); - this.groupBoxGamePaths.Location = new System.Drawing.Point(6, 6); - this.groupBoxGamePaths.Name = "groupBoxGamePaths"; - this.groupBoxGamePaths.Size = new System.Drawing.Size(480, 52); - this.groupBoxGamePaths.TabIndex = 53; - this.groupBoxGamePaths.TabStop = false; - this.groupBoxGamePaths.Text = "Paths"; - // - // labelGamePath - // - this.labelGamePath.AutoSize = true; - this.labelGamePath.Location = new System.Drawing.Point(6, 20); - this.labelGamePath.Name = "labelGamePath"; - this.labelGamePath.Size = new System.Drawing.Size(78, 13); - this.labelGamePath.TabIndex = 14; - this.labelGamePath.Text = "Game location:"; - // - // textBoxGamePath - // - this.textBoxGamePath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxGamePath.Location = new System.Drawing.Point(123, 17); - this.textBoxGamePath.Name = "textBoxGamePath"; - this.textBoxGamePath.Size = new System.Drawing.Size(319, 20); - this.textBoxGamePath.TabIndex = 15; - this.textBoxGamePath.TextChanged += new System.EventHandler(this.textBoxGamePath_TextChanged); - // - // buttonPickGamePath - // - this.buttonPickGamePath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonPickGamePath.Location = new System.Drawing.Point(448, 15); - this.buttonPickGamePath.Name = "buttonPickGamePath"; - this.buttonPickGamePath.Size = new System.Drawing.Size(26, 23); - this.buttonPickGamePath.TabIndex = 16; - this.buttonPickGamePath.Text = "..."; - this.buttonPickGamePath.UseVisualStyleBackColor = true; - this.buttonPickGamePath.Click += new System.EventHandler(this.buttonPickGamePath_Click); - // // openFileDialogMod // this.openFileDialogMod.Filter = "All Archives|*.zip;*.rar;*.7z;*.tar;*.tar.gz;*.gz;*.xz;*.lz;*.bz2|Archive2|*.ba2"; @@ -668,27 +534,125 @@ private void InitializeComponent() this.openFileDialogBA2.Filter = "Archive2|*.ba2"; this.openFileDialogBA2.Title = "Add *.ba2 archive."; // - // buttonModsApplyTextBoxes + // toolStripButtonAddMod // - this.buttonModsApplyTextBoxes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonModsApplyTextBoxes.Location = new System.Drawing.Point(347, 345); - this.buttonModsApplyTextBoxes.Name = "buttonModsApplyTextBoxes"; - this.buttonModsApplyTextBoxes.Size = new System.Drawing.Size(127, 23); - this.buttonModsApplyTextBoxes.TabIndex = 59; - this.buttonModsApplyTextBoxes.Text = "Apply changes"; - this.buttonModsApplyTextBoxes.UseVisualStyleBackColor = true; - this.buttonModsApplyTextBoxes.Click += new System.EventHandler(this.buttonModsApplyTextBoxes_Click); + this.toolStripButtonAddMod.AutoSize = false; + this.toolStripButtonAddMod.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonAddMod.Image = global::Fo76ini.Properties.Resources.plus; + this.toolStripButtonAddMod.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonAddMod.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonAddMod.Name = "toolStripButtonAddMod"; + this.toolStripButtonAddMod.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonAddMod.Text = "Add mod (from archive)"; + this.toolStripButtonAddMod.Click += new System.EventHandler(this.toolStripButtonAddMod_Click); // - // buttonModsResetTextboxes + // toolStripButtonAddModFrozen // - this.buttonModsResetTextboxes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonModsResetTextboxes.Location = new System.Drawing.Point(243, 345); - this.buttonModsResetTextboxes.Name = "buttonModsResetTextboxes"; - this.buttonModsResetTextboxes.Size = new System.Drawing.Size(98, 23); - this.buttonModsResetTextboxes.TabIndex = 60; - this.buttonModsResetTextboxes.Text = "Reset"; - this.buttonModsResetTextboxes.UseVisualStyleBackColor = true; - this.buttonModsResetTextboxes.Click += new System.EventHandler(this.buttonModsResetTextboxes_Click); + this.toolStripButtonAddModFrozen.AutoSize = false; + this.toolStripButtonAddModFrozen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonAddModFrozen.Image = global::Fo76ini.Properties.Resources.frozen_plus; + this.toolStripButtonAddModFrozen.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonAddModFrozen.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonAddModFrozen.Name = "toolStripButtonAddModFrozen"; + this.toolStripButtonAddModFrozen.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonAddModFrozen.Text = "Add mod (from *.ba2 archive)"; + this.toolStripButtonAddModFrozen.Click += new System.EventHandler(this.toolStripButtonAddModFrozen_Click); + // + // toolStripButtonAddModFolder + // + this.toolStripButtonAddModFolder.AutoSize = false; + this.toolStripButtonAddModFolder.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonAddModFolder.Image = global::Fo76ini.Properties.Resources.folder_plus; + this.toolStripButtonAddModFolder.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonAddModFolder.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonAddModFolder.Name = "toolStripButtonAddModFolder"; + this.toolStripButtonAddModFolder.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonAddModFolder.Text = "Add mod (from folder)"; + this.toolStripButtonAddModFolder.Click += new System.EventHandler(this.toolStripButtonAddModFolder_Click); + // + // toolStripButtonCheckAll + // + this.toolStripButtonCheckAll.AutoSize = false; + this.toolStripButtonCheckAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonCheckAll.Image = global::Fo76ini.Properties.Resources.checkbox_checked; + this.toolStripButtonCheckAll.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonCheckAll.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonCheckAll.Name = "toolStripButtonCheckAll"; + this.toolStripButtonCheckAll.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonCheckAll.Text = "Check/uncheck all"; + this.toolStripButtonCheckAll.Click += new System.EventHandler(this.toolStripButtonCheckAll_Click); + // + // toolStripButtonMoveUp + // + this.toolStripButtonMoveUp.AutoSize = false; + this.toolStripButtonMoveUp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonMoveUp.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonMoveUp.Image"))); + this.toolStripButtonMoveUp.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonMoveUp.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonMoveUp.Name = "toolStripButtonMoveUp"; + this.toolStripButtonMoveUp.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonMoveUp.Text = "Move up"; + this.toolStripButtonMoveUp.Click += new System.EventHandler(this.toolStripButtonMoveUp_Click); + // + // toolStripButtonMoveDown + // + this.toolStripButtonMoveDown.AutoSize = false; + this.toolStripButtonMoveDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonMoveDown.Image = global::Fo76ini.Properties.Resources.arrow_down; + this.toolStripButtonMoveDown.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonMoveDown.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonMoveDown.Name = "toolStripButtonMoveDown"; + this.toolStripButtonMoveDown.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonMoveDown.Text = "Move down"; + this.toolStripButtonMoveDown.Click += new System.EventHandler(this.toolStripButtonMoveDown_Click); + // + // toolStripButtonModEdit + // + this.toolStripButtonModEdit.AutoSize = false; + this.toolStripButtonModEdit.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonModEdit.Image = global::Fo76ini.Properties.Resources.pencil; + this.toolStripButtonModEdit.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonModEdit.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonModEdit.Name = "toolStripButtonModEdit"; + this.toolStripButtonModEdit.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonModEdit.Text = "Edit mod details"; + this.toolStripButtonModEdit.Click += new System.EventHandler(this.toolStripButtonModEdit_Click); + // + // toolStripButtonModOpenFolder + // + this.toolStripButtonModOpenFolder.AutoSize = false; + this.toolStripButtonModOpenFolder.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonModOpenFolder.Image = global::Fo76ini.Properties.Resources.folder_open; + this.toolStripButtonModOpenFolder.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonModOpenFolder.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonModOpenFolder.Name = "toolStripButtonModOpenFolder"; + this.toolStripButtonModOpenFolder.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonModOpenFolder.Text = "Open mod folder"; + this.toolStripButtonModOpenFolder.Click += new System.EventHandler(this.toolStripButtonModOpenFolder_Click); + // + // toolStripButtonDeleteMod + // + this.toolStripButtonDeleteMod.AutoSize = false; + this.toolStripButtonDeleteMod.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonDeleteMod.Image = global::Fo76ini.Properties.Resources.bin; + this.toolStripButtonDeleteMod.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonDeleteMod.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonDeleteMod.Name = "toolStripButtonDeleteMod"; + this.toolStripButtonDeleteMod.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonDeleteMod.Text = "Delete mod"; + this.toolStripButtonDeleteMod.Click += new System.EventHandler(this.toolStripButtonDeleteMod_Click); + // + // toolStripButtonUnfreeze + // + this.toolStripButtonUnfreeze.AutoSize = false; + this.toolStripButtonUnfreeze.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonUnfreeze.Image = global::Fo76ini.Properties.Resources.defrost; + this.toolStripButtonUnfreeze.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonUnfreeze.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonUnfreeze.Name = "toolStripButtonUnfreeze"; + this.toolStripButtonUnfreeze.Size = new System.Drawing.Size(30, 30); + this.toolStripButtonUnfreeze.Text = "Unfreeze"; + this.toolStripButtonUnfreeze.Click += new System.EventHandler(this.toolStripButtonUnfreeze_Click); // // FormMods // @@ -701,6 +665,7 @@ private void InitializeComponent() this.Controls.Add(this.labelModsDeploy); this.Controls.Add(this.menuStrip1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.KeyPreview = true; this.MinimumSize = new System.Drawing.Size(540, 600); this.Name = "FormMods"; this.Text = "Manage mods"; @@ -715,8 +680,6 @@ private void InitializeComponent() this.tabPageModsSettings.ResumeLayout(false); this.groupBoxLists.ResumeLayout(false); this.groupBoxLists.PerformLayout(); - this.groupBoxGamePaths.ResumeLayout(false); - this.groupBoxGamePaths.PerformLayout(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); @@ -765,10 +728,6 @@ private void InitializeComponent() private System.Windows.Forms.FolderBrowserDialog folderBrowserDialogMod; private System.Windows.Forms.CheckBox checkBoxDisableMods; private System.Windows.Forms.OpenFileDialog openFileDialogGamePath; - private System.Windows.Forms.GroupBox groupBoxGamePaths; - private System.Windows.Forms.Label labelGamePath; - private System.Windows.Forms.TextBox textBoxGamePath; - private System.Windows.Forms.Button buttonPickGamePath; private System.Windows.Forms.ColumnHeader columnHeaderInstallInto; private System.Windows.Forms.ColumnHeader columnHeaderArchiveName; private System.Windows.Forms.Panel panel1; @@ -789,5 +748,6 @@ private void InitializeComponent() private System.Windows.Forms.Label labelsResourceArchive2List; private System.Windows.Forms.Button buttonModsResetTextboxes; private System.Windows.Forms.Button buttonModsApplyTextBoxes; + private System.Windows.Forms.ToolStripButton toolStripButtonUnfreeze; } } \ No newline at end of file diff --git a/Fo76ini/FormMods.cs b/Fo76ini/FormMods.cs index a36abb7..2cae481 100644 --- a/Fo76ini/FormMods.cs +++ b/Fo76ini/FormMods.cs @@ -38,6 +38,7 @@ public FormMods() this.FormClosing += this.FormMods_FormClosing; + this.KeyDown += this.FormMods_KeyDown; this.listViewMods.ItemCheck += this.listViewMods_ItemCheck; /* @@ -255,7 +256,7 @@ private void UpdateSettings() if (!IniFiles.Instance.IsLoaded()) return; this.checkBoxDisableMods.Checked = ManagedMods.Instance.nuclearWinterMode; - this.textBoxGamePath.Text = ManagedMods.Instance.GamePath; + //this.textBoxGamePath.Text = ManagedMods.Instance.GamePath; this.textBoxsResourceArchive2List.Text = String.Join(Environment.NewLine, IniFiles.Instance.GetString(IniFile.F76Custom, "Archive", "sResourceArchive2List", "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)); this.textBoxsResourceIndexFileList.Text = String.Join(Environment.NewLine, IniFiles.Instance.GetString(IniFile.F76Custom, "Archive", "sResourceIndexFileList", "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)); @@ -348,6 +349,45 @@ private void FormMods_FormClosing(object sender, FormClosingEventArgs e) } } + private void FormMods_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.F1) + { + // Open README + showREADMEToolStripMenuItem_Click(sender, e); + } + else if (e.KeyCode == Keys.F5) + { + // Reload UI: + reloadUIToolStripMenuItem_Click(sender, e); + } + + // These shortcuts only apply to the mod list: + if (this.listViewMods.Focused) + { + if (e.KeyCode == Keys.Delete || e.KeyCode == Keys.Back) + { + // Delete mods: + toolStripButtonDeleteMod_Click(sender, e); + } + else if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) + { + // Edit mods: + toolStripButtonModEdit_Click(sender, e); + } + else if (e.Control && e.KeyCode == Keys.Up) + { + // Move mods up: + toolStripButtonMoveUp_Click(sender, e); + } + else if (e.Control && e.KeyCode == Keys.Down) + { + // Move mods down: + toolStripButtonMoveDown_Click(sender, e); + } + } + } + private void listViewMods_SelectedIndexChanged(object sender, EventArgs e) { if (this.listViewMods.SelectedItems.Count > 0) @@ -669,6 +709,22 @@ private void toolStripButtonAddModFrozen_Click(object sender, EventArgs e) } } + // Unfreeze + private void toolStripButtonUnfreeze_Click(object sender, EventArgs e) + { + if (!ManagedMods.Instance.ValidateGamePath()) + { + MsgBox.ShowID("modsGamePathNotSet", MessageBoxIcon.Information); + return; + } + List indices = new List(); + foreach (ListViewItem item in this.listViewMods.SelectedItems) + indices.Add(item.Index); + Thread thread = new Thread(() => UnfreezeBulkMods(indices)); + thread.IsBackground = true; + thread.Start(); + } + /* @@ -774,7 +830,7 @@ private void repairddsFilesToolStripMenuItem_Click(object sender, EventArgs e) */ // Pick game path - private void buttonPickGamePath_Click(object sender, EventArgs e) + /*private void buttonPickGamePath_Click(object sender, EventArgs e) { if (ManagedMods.Instance.isDeploymentNecessary()) { @@ -825,7 +881,7 @@ private void textBoxGamePath_TextChanged(object sender, EventArgs e) this.textBoxGamePath.BackColor = Color.Red; } } - } + }*/ // Clean lists private void buttonModsCleanLists_Click(object sender, EventArgs e) @@ -871,19 +927,6 @@ private void buttonModsResetTextboxes_Click(object sender, EventArgs e) this.textBoxsResourceIndexFileList.Text = String.Join(Environment.NewLine, IniFiles.Instance.GetString(IniFile.F76Custom, "Archive", "sResourceIndexFileList", "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)); } - // Bethesda.net picked - /*private void radioButtonEditionBethesdaNet_CheckedChanged(object sender, EventArgs e) - { - if (this.radioButtonEditionBethesdaNet.Checked) - ChangeGameEdition(GameEdition.BethesdaNet); - } - - // Steam picked - private void radioButtonEditionSteam_CheckedChanged(object sender, EventArgs e) - { - if (this.radioButtonEditionSteam.Checked) - ChangeGameEdition(GameEdition.Steam); - }*/ public void ChangeGameEdition(GameEdition gameEdition) { @@ -892,7 +935,7 @@ public void ChangeGameEdition(GameEdition gameEdition) IniFiles.Instance.Set(IniFile.Config, "Preferences", "uGameEdition", (uint)gameEdition); ManagedMods.Instance.GameEdition = gameEdition; ManagedMods.Instance.GamePath = IniFiles.Instance.GetString(IniFile.Config, "Preferences", ManagedMods.Instance.GamePathKey, ""); - this.textBoxGamePath.Text = ManagedMods.Instance.GamePath; + //this.textBoxGamePath.Text = ManagedMods.Instance.GamePath; ManagedMods.Instance.Load(); UpdateUI(); } @@ -985,6 +1028,22 @@ private void InstallBulk(String[] files) } } + private void UnfreezeBulkMods(List indices) + { + Invoke(DisableUI); + ManagedMods.Instance.UnfreezeMods(indices, + (text, percent) => { + Invoke(() => Display(text)); + Invoke(() => { if (percent >= 0) { ProgressBarContinuous(percent); } else { ProgressBarMarquee(); } }); + }, + () => { + Invoke(() => EnableUI()); + Invoke(() => UpdateModList()); + Invoke(() => UpdateLabel()); + } + ); + } + private void DeleteMod(int index) { Invoke(() => DisableUI()); diff --git a/Fo76ini/FormMods.resx b/Fo76ini/FormMods.resx index 84143c3..1f5172f 100644 --- a/Fo76ini/FormMods.resx +++ b/Fo76ini/FormMods.resx @@ -123,9 +123,6 @@ 222, 17 - - 222, 17 - diff --git a/Fo76ini/IniFiles.cs b/Fo76ini/IniFiles.cs index 2111341..606b067 100644 --- a/Fo76ini/IniFiles.cs +++ b/Fo76ini/IniFiles.cs @@ -97,7 +97,7 @@ private IniFiles() iniParserConfig.AllowCreateSectionsOnFly = true; iniParserConfig.AssigmentSpacer = ""; iniParserConfig.CaseInsensitive = true; - iniParserConfig.CommentRegex = new System.Text.RegularExpressions.Regex(@";.*"); + iniParserConfig.CommentRegex = new System.Text.RegularExpressions.Regex(@"^;.*"); // Be very generous, allow everything: iniParserConfig.AllowDuplicateKeys = true; diff --git a/Fo76ini/Mods.cs b/Fo76ini/Mods.cs index df2d4c4..ed87851 100644 --- a/Fo76ini/Mods.cs +++ b/Fo76ini/Mods.cs @@ -512,6 +512,19 @@ public void DeleteMods(List indices, Action done = null) done(); } + public void UnfreezeMods(List indices, Action updateProgress = null, Action done = null) + { + foreach (int index in indices) + { + Mod mod = this.Mods[index]; + if (updateProgress != null) + updateProgress($"Unfreezing {mod.Title}...", (index + 1) / indices.Count() * 100); + mod.Unfreeze(); + } + if (done != null) + done(); + } + public bool ValidateGamePath(String path) { return path != null && path.Trim().Length > 0 && Directory.Exists(path) && Directory.Exists(Path.Combine(path, "Data")); @@ -1192,7 +1205,7 @@ public List GetConflictingFiles() foreach (String filePath in upperFiles) { String relUpperPath = Utils.MakeRelativePath(upperPath, filePath); - if (lowerRelPaths.Contains(relUpperPath)) + if (!relUpperPath.Contains("frozen.ba2") && lowerRelPaths.Contains(relUpperPath)) { if (!conflict.conflictingFiles.Contains(relUpperPath)) conflict.conflictingFiles.Add(relUpperPath); @@ -1831,6 +1844,7 @@ public void CopyINILists() { if (!IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bMultipleGameEditionsUsed", false)) return; + String suffix = ManagedMods.GetEditionSuffix(this.GameEdition); IniFiles.Instance.Set(IniFile.Config, "Mods", "sResourceIndexFileList" + suffix, String.Join(",", IniFiles.Instance.GetString(IniFile.F76Custom, "Archive", "sResourceIndexFileList", ""))); IniFiles.Instance.Set(IniFile.Config, "Mods", "sResourceArchive2List" + suffix, String.Join(",", IniFiles.Instance.GetString(IniFile.F76Custom, "Archive", "sResourceArchive2List", ""))); @@ -1842,16 +1856,25 @@ public void LoadINILists() { if (!IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bMultipleGameEditionsUsed", false)) return; + String suffix = ManagedMods.GetEditionSuffix(this.GameEdition); String sResourceIndexFileList = IniFiles.Instance.GetString(IniFile.Config, "Mods", "sResourceIndexFileList" + suffix, ""); String sResourceArchive2List = IniFiles.Instance.GetString(IniFile.Config, "Mods", "sResourceArchive2List" + suffix, ""); String sResourceDataDirsFinal = IniFiles.Instance.GetString(IniFile.Config, "Mods", "sResourceDataDirsFinal" + suffix, ""); - if (IniFiles.Instance.Exists(IniFile.Config, "Mods", "sResourceIndexFileList" + suffix)) + + if (sResourceIndexFileList.Length > 0 || IniFiles.Instance.Exists(IniFile.F76Custom, "Mods", "sResourceIndexFileList")) IniFiles.Instance.Set(IniFile.F76Custom, "Archive", "sResourceIndexFileList", sResourceIndexFileList); - if (IniFiles.Instance.Exists(IniFile.Config, "Mods", "sResourceArchive2List" + suffix)) + if (sResourceArchive2List.Length > 0 || IniFiles.Instance.Exists(IniFile.F76Custom, "Mods", "sResourceArchive2List")) IniFiles.Instance.Set(IniFile.F76Custom, "Archive", "sResourceArchive2List", sResourceArchive2List); - if (sResourceDataDirsFinal.Length > 0) + if (sResourceDataDirsFinal.Length > 0 || IniFiles.Instance.Exists(IniFile.F76Custom, "Mods", "sResourceDataDirsFinal")) IniFiles.Instance.Set(IniFile.F76Custom, "Archive", "sResourceDataDirsFinal", sResourceDataDirsFinal); + + if (IniFiles.Instance.GetString(IniFile.F76Custom, "Mods", "sResourceIndexFileList", "").Trim().Length == 0) + IniFiles.Instance.Remove(IniFile.F76Custom, "Mods", "sResourceIndexFileList"); + if (IniFiles.Instance.GetString(IniFile.F76Custom, "Mods", "sResourceArchive2List", "").Trim().Length == 0) + IniFiles.Instance.Remove(IniFile.F76Custom, "Mods", "sResourceArchive2List"); + if (IniFiles.Instance.GetString(IniFile.F76Custom, "Mods", "sResourceDataDirsFinal", "").Trim().Length == 0) + IniFiles.Instance.Remove(IniFile.F76Custom, "Mods", "sResourceDataDirsFinal"); } } diff --git a/Fo76ini/Properties/AssemblyInfo.cs b/Fo76ini/Properties/AssemblyInfo.cs index c17ec21..4e9cfde 100644 --- a/Fo76ini/Properties/AssemblyInfo.cs +++ b/Fo76ini/Properties/AssemblyInfo.cs @@ -1,16 +1,17 @@ -using System.Reflection; +using System.Resources; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("Fo76ini")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyTitle("Fallout 76 Quick Configuration")] +[assembly: AssemblyDescription("This tool allows you to tweak INI settings and install mods.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Fo76ini")] -[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyProduct("Fallout 76 Quick Configuration")] +[assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -34,3 +35,4 @@ // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguage("en-US")] diff --git a/Fo76ini/Properties/Resources.Designer.cs b/Fo76ini/Properties/Resources.Designer.cs index 143f1b6..38f81b0 100644 --- a/Fo76ini/Properties/Resources.Designer.cs +++ b/Fo76ini/Properties/Resources.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace Fo76ini.Properties { /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,7 +33,7 @@ internal Resources() { } /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Resources() { } /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal Resources() { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap arrow_down { get { @@ -71,7 +71,7 @@ internal static System.Drawing.Bitmap arrow_down { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap arrow_up { get { @@ -81,7 +81,7 @@ internal static System.Drawing.Bitmap arrow_up { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap bin { get { @@ -91,7 +91,7 @@ internal static System.Drawing.Bitmap bin { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap checkbox_checked { get { @@ -101,7 +101,17 @@ internal static System.Drawing.Bitmap checkbox_checked { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap defrost { + get { + object obj = ResourceManager.GetObject("defrost", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap error { get { @@ -111,7 +121,7 @@ internal static System.Drawing.Bitmap error { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap folder_open { get { @@ -121,7 +131,7 @@ internal static System.Drawing.Bitmap folder_open { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap folder_plus { get { @@ -131,7 +141,7 @@ internal static System.Drawing.Bitmap folder_plus { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap frozen_plus { get { @@ -141,7 +151,7 @@ internal static System.Drawing.Bitmap frozen_plus { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap icon { get { @@ -151,7 +161,7 @@ internal static System.Drawing.Bitmap icon { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap info { get { @@ -161,7 +171,7 @@ internal static System.Drawing.Bitmap info { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap pencil { get { @@ -171,7 +181,7 @@ internal static System.Drawing.Bitmap pencil { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap plus { get { @@ -181,7 +191,7 @@ internal static System.Drawing.Bitmap plus { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap warning { get { diff --git a/Fo76ini/Properties/Resources.resx b/Fo76ini/Properties/Resources.resx index 79e1f68..2dac1b0 100644 --- a/Fo76ini/Properties/Resources.resx +++ b/Fo76ini/Properties/Resources.resx @@ -157,4 +157,7 @@ ..\icons\frozen-plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\icons\defrost.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Fo76ini/icons/defrost.png b/Fo76ini/icons/defrost.png new file mode 100644 index 0000000..fcad0f3 Binary files /dev/null and b/Fo76ini/icons/defrost.png differ diff --git a/Fo76ini/icons/freeze.png b/Fo76ini/icons/freeze.png new file mode 100644 index 0000000..b5d0528 Binary files /dev/null and b/Fo76ini/icons/freeze.png differ diff --git a/Fo76ini/languages/de-DE.xml b/Fo76ini/languages/de-DE.xml index f6cb28b..7a5fde5 100644 --- a/Fo76ini/languages/de-DE.xml +++ b/Fo76ini/languages/de-DE.xml @@ -1,5 +1,5 @@  - + @@ -149,9 +149,9 @@ Bitte wähle Archive2.exe