From adaef41213dbc42bea3373cf7e5bcd8f4afff3ac Mon Sep 17 00:00:00 2001 From: FelisDiligens <47528453+FelisDiligens@users.noreply.github.com> Date: Wed, 9 Sep 2020 07:26:39 +0200 Subject: [PATCH 1/2] Added bAutoSignin, fixed 3 bugs --- Fo76ini/Forms/Form1/Form1.Colors.cs | 18 +++++++-------- Fo76ini/Forms/Form1/Form1.Designer.cs | 19 ++++++++++++++-- Fo76ini/Forms/Form1/Form1.cs | 32 ++++++++++++++++++++++----- Fo76ini/IniFiles.cs | 10 +++++---- Fo76ini/Shared.cs | 2 +- 5 files changed, 59 insertions(+), 22 deletions(-) diff --git a/Fo76ini/Forms/Form1/Form1.Colors.cs b/Fo76ini/Forms/Form1/Form1.Colors.cs index 3fc179d..d4ced1d 100644 --- a/Fo76ini/Forms/Form1/Form1.Colors.cs +++ b/Fo76ini/Forms/Form1/Form1.Colors.cs @@ -88,9 +88,9 @@ public Color PipboyColor { get { - 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); + float r = Utils.Clamp(IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorR", 0.1f), 0f, 1f); + float g = Utils.Clamp(IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorG", 1.0f), 0f, 1f); + float b = Utils.Clamp(IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorB", 0.5f), 0f, 1f); return Color.FromArgb( Convert.ToInt32(r * 255), Convert.ToInt32(g * 255), @@ -113,9 +113,9 @@ public Color QuickboyColor { get { - float r = IniFiles.Instance.GetFloat("Pipboy", "fQuickBoyEffectColorR", 1.0f); - float g = IniFiles.Instance.GetFloat("Pipboy", "fQuickBoyEffectColorG", 0.78f); - float b = IniFiles.Instance.GetFloat("Pipboy", "fQuickBoyEffectColorB", 0.0f); + float r = Utils.Clamp(IniFiles.Instance.GetFloat("Pipboy", "fQuickBoyEffectColorR", 1.0f), 0f, 1f); + float g = Utils.Clamp(IniFiles.Instance.GetFloat("Pipboy", "fQuickBoyEffectColorG", 0.78f), 0f, 1f); + float b = Utils.Clamp(IniFiles.Instance.GetFloat("Pipboy", "fQuickBoyEffectColorB", 0.0f), 0f, 1f); return Color.FromArgb( Convert.ToInt32(r * 255), Convert.ToInt32(g * 255), @@ -139,9 +139,9 @@ public Color PowerArmorPipboyColor { get { - float r = IniFiles.Instance.GetFloat("Pipboy", "fPAEffectColorR", 1.0f); - float g = IniFiles.Instance.GetFloat("Pipboy", "fPAEffectColorG", 0.78f); - float b = IniFiles.Instance.GetFloat("Pipboy", "fPAEffectColorB", 0.0f); + float r = Utils.Clamp(IniFiles.Instance.GetFloat("Pipboy", "fPAEffectColorR", 1.0f), 0f, 1f); + float g = Utils.Clamp(IniFiles.Instance.GetFloat("Pipboy", "fPAEffectColorG", 0.78f), 0f, 1f); + float b = Utils.Clamp(IniFiles.Instance.GetFloat("Pipboy", "fPAEffectColorB", 0.0f), 0f, 1f); return Color.FromArgb( Convert.ToInt32(r * 255), Convert.ToInt32(g * 255), diff --git a/Fo76ini/Forms/Form1/Form1.Designer.cs b/Fo76ini/Forms/Form1/Form1.Designer.cs index 54a10cd..e928338 100644 --- a/Fo76ini/Forms/Form1/Form1.Designer.cs +++ b/Fo76ini/Forms/Form1/Form1.Designer.cs @@ -410,6 +410,7 @@ private void InitializeComponent() this.backgroundWorkerEnableNWMode = new System.ComponentModel.BackgroundWorker(); this.backgroundWorkerDisableNWMode = new System.ComponentModel.BackgroundWorker(); this.pictureBoxLoadingGIF = new System.Windows.Forms.PictureBox(); + this.checkBoxAutoSignin = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.numPipboyTargetWidth)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numPipboyTargetHeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numCustomResH)).BeginInit(); @@ -3384,6 +3385,7 @@ private void InitializeComponent() // // groupBoxLogin // + this.groupBoxLogin.Controls.Add(this.checkBoxAutoSignin); this.groupBoxLogin.Controls.Add(this.radioButtonAccount8); this.groupBoxLogin.Controls.Add(this.radioButtonAccount7); this.groupBoxLogin.Controls.Add(this.radioButtonAccount6); @@ -3499,7 +3501,7 @@ private void InitializeComponent() // checkBoxDisableSteam // this.checkBoxDisableSteam.AutoSize = true; - this.checkBoxDisableSteam.Location = new System.Drawing.Point(12, 165); + this.checkBoxDisableSteam.Location = new System.Drawing.Point(12, 199); this.checkBoxDisableSteam.Name = "checkBoxDisableSteam"; this.checkBoxDisableSteam.Size = new System.Drawing.Size(94, 17); this.checkBoxDisableSteam.TabIndex = 6; @@ -3511,7 +3513,7 @@ private void InitializeComponent() this.labelCredentialsExplanation.AutoSize = true; this.labelCredentialsExplanation.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelCredentialsExplanation.ForeColor = System.Drawing.Color.DimGray; - this.labelCredentialsExplanation.Location = new System.Drawing.Point(9, 200); + this.labelCredentialsExplanation.Location = new System.Drawing.Point(9, 235); this.labelCredentialsExplanation.Name = "labelCredentialsExplanation"; this.labelCredentialsExplanation.Size = new System.Drawing.Size(349, 91); this.labelCredentialsExplanation.TabIndex = 5; @@ -5324,6 +5326,18 @@ private void InitializeComponent() this.pictureBoxLoadingGIF.TabStop = false; this.pictureBoxLoadingGIF.Visible = false; // + // checkBoxAutoSignin + // + this.checkBoxAutoSignin.AutoSize = true; + this.checkBoxAutoSignin.Location = new System.Drawing.Point(12, 176); + this.checkBoxAutoSignin.Name = "checkBoxAutoSignin"; + this.checkBoxAutoSignin.Size = new System.Drawing.Size(121, 17); + this.checkBoxAutoSignin.TabIndex = 20; + this.checkBoxAutoSignin.Text = "Automatically sign-in"; + this.toolTip.SetToolTip(this.checkBoxAutoSignin, "Enabling this will skip the login prompt if you provide your login credentials.\r\n" + + "\r\nAffected values: bAutoSignin\r\nAffected files: Fallout76Custom.ini"); + this.checkBoxAutoSignin.UseVisualStyleBackColor = true; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -5895,6 +5909,7 @@ private void InitializeComponent() private System.Windows.Forms.PictureBox pictureBoxLoadingGIF; private System.Windows.Forms.LinkLabel linkLabelAttribution; private System.Windows.Forms.CheckBox checkBoxPlayNotificationSound; + private System.Windows.Forms.CheckBox checkBoxAutoSignin; } } diff --git a/Fo76ini/Forms/Form1/Form1.cs b/Fo76ini/Forms/Form1/Form1.cs index 3c51795..74e9f4d 100644 --- a/Fo76ini/Forms/Form1/Form1.cs +++ b/Fo76ini/Forms/Form1/Form1.cs @@ -236,11 +236,10 @@ private void Form1_Load(object sender, EventArgs e) this.formMods = new FormMods(); - // Load QuickConfiguration.ini + // Load config.ini IniFiles.Instance.LoadConfig(); // Load the languages - //LookupLanguages(); Localization.AssignDropBox(this.comboBoxLanguage); Localization.GenerateTemplate(); Localization.LookupLanguages(); @@ -588,12 +587,30 @@ private void AddAllEventHandler() */ // Game Edition - uiLoader.LinkList( + /*uiLoader.LinkList( new RadioButton[] { this.radioButtonEditionBethesdaNet, this.radioButtonEditionSteam, this.radioButtonEditionBethesdaNetPTS, this.radioButtonEditionMSStore }, new String[] { "1", "2", "3", "4" }, IniFile.Config, "Preferences", "uGameEdition", "0" - ); + );*/ + uiLoader.Add(() => + { + switch (Shared.GameEdition) + { + case GameEdition.Steam: + this.radioButtonEditionSteam.Checked = true; + break; + case GameEdition.BethesdaNet: + this.radioButtonEditionBethesdaNet.Checked = true; + break; + case GameEdition.BethesdaNetPTS: + this.radioButtonEditionBethesdaNetPTS.Checked = true; + break; + case GameEdition.MSStore: + this.radioButtonEditionMSStore.Checked = true; + break; + } + }); // Launch options uiLoader.LinkList( @@ -657,6 +674,9 @@ private void AddAllEventHandler() // Disable Steam: uiLoader.LinkBoolNegated(this.checkBoxDisableSteam, !alternativeMode ? IniFile.F76Custom : IniFile.F76, "General", "bSteamEnabled", true); + // Automatically sign-in: + uiLoader.LinkBool(this.checkBoxAutoSignin, !alternativeMode ? IniFile.F76Custom : IniFile.F76, "Login", "bAutoSignin", false); + // Play intro videos uiLoader.LinkCustom(this.checkBoxIntroVideos, () => { @@ -1627,11 +1647,11 @@ private void buttonPipboyTargetSetRecommended_Click(object sender, EventArgs e) private void toolStripButtonManageMods_Click(object sender, EventArgs e) { - if (!formModsBackupCreated) + /*if (!formModsBackupCreated) { IniFiles.Instance.BackupAll("Backup_BeforeManageMods"); // Just to be sure... formModsBackupCreated = true; - } + }*/ this.formMods.OpenUI(); } diff --git a/Fo76ini/IniFiles.cs b/Fo76ini/IniFiles.cs index 0ef4fca..0a3359a 100644 --- a/Fo76ini/IniFiles.cs +++ b/Fo76ini/IniFiles.cs @@ -196,8 +196,8 @@ public void LoadGameInis() { // Do Fallout76.ini and Fallout76Prefs.ini exist? if (File.Exists(GetIniPath(IniFile.F76, GameEdition.Steam)) && File.Exists(GetIniPath(IniFile.F76Prefs, GameEdition.Steam))) - Shared.ChangeGameEdition(GameEdition.Steam); - //this.GameEdition = GameEdition.Steam; + //Shared.ChangeGameEdition(GameEdition.Steam); + Shared.GameEdition = GameEdition.Steam; else throw new FileNotFoundException($"{GetIniName(IniFile.F76)} and {GetIniName(IniFile.F76Prefs)} not found"); } @@ -205,8 +205,8 @@ public void LoadGameInis() { // Do Project76.ini and Project76Prefs.ini exist? if (File.Exists(GetIniPath(IniFile.F76, GameEdition.MSStore)) && File.Exists(GetIniPath(IniFile.F76Prefs, GameEdition.MSStore))) - Shared.ChangeGameEdition(GameEdition.MSStore); - //this.GameEdition = GameEdition.MSStore; + //Shared.ChangeGameEdition(GameEdition.MSStore); + Shared.GameEdition = GameEdition.MSStore; else throw new FileNotFoundException($"{GetIniName(IniFile.F76)} and {GetIniName(IniFile.F76Prefs)} not found"); } @@ -248,6 +248,8 @@ public void ChangeGameEdition(GameEdition edition) //this.GameEdition = edition; /*if (reloadRequired) LoadGameInis();*/ + IniFiles.Instance.Set(IniFile.Config, "Preferences", "uGameEdition", (int)edition); + UpdateLastModifiedDates(); } diff --git a/Fo76ini/Shared.cs b/Fo76ini/Shared.cs index 7655cf6..297a0e2 100644 --- a/Fo76ini/Shared.cs +++ b/Fo76ini/Shared.cs @@ -18,7 +18,7 @@ public enum GameEdition public class Shared { - public const String VERSION = "1.8.2"; + public const String VERSION = "1.8.3"; public static String OldAppConfigFolder = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "Fallout 76 Quick Configuration"); public static String AppConfigFolder = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "Fallout 76 Quick Configuration"); From 5133cb93e1d0ae18ca2697e9128e651d7d1c2f35 Mon Sep 17 00:00:00 2001 From: FelisDiligens <47528453+FelisDiligens@users.noreply.github.com> Date: Wed, 9 Sep 2020 07:38:03 +0200 Subject: [PATCH 2/2] v1.8.3 --- Fo76ini/Forms/Form1/Form1.Designer.cs | 27 ++++++++++++++------------- Fo76ini/languages/de-DE.xml | 23 ++++++++++++++++------- Fo76ini/languages/en-US.xml | 13 +++++++++++-- VERSION | 2 +- setup.iss | 2 +- 5 files changed, 43 insertions(+), 24 deletions(-) diff --git a/Fo76ini/Forms/Form1/Form1.Designer.cs b/Fo76ini/Forms/Form1/Form1.Designer.cs index e928338..e4baed6 100644 --- a/Fo76ini/Forms/Form1/Form1.Designer.cs +++ b/Fo76ini/Forms/Form1/Form1.Designer.cs @@ -136,6 +136,7 @@ private void InitializeComponent() this.checkBoxbApplyCameraNodeAnimations = new System.Windows.Forms.CheckBox(); this.labelScreenshotIndex = new System.Windows.Forms.Label(); this.checkBoxAlternativeINIMode = new System.Windows.Forms.CheckBox(); + this.checkBoxAutoSignin = new System.Windows.Forms.CheckBox(); this.colorDialog = new System.Windows.Forms.ColorDialog(); this.timerCheckFiles = new System.Windows.Forms.Timer(this.components); this.openFileDialogGamePath = new System.Windows.Forms.OpenFileDialog(); @@ -410,7 +411,6 @@ private void InitializeComponent() this.backgroundWorkerEnableNWMode = new System.ComponentModel.BackgroundWorker(); this.backgroundWorkerDisableNWMode = new System.ComponentModel.BackgroundWorker(); this.pictureBoxLoadingGIF = new System.Windows.Forms.PictureBox(); - this.checkBoxAutoSignin = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.numPipboyTargetWidth)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numPipboyTargetHeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numCustomResH)).BeginInit(); @@ -1921,6 +1921,18 @@ private void InitializeComponent() this.checkBoxAlternativeINIMode.UseVisualStyleBackColor = true; this.checkBoxAlternativeINIMode.CheckedChanged += new System.EventHandler(this.checkBoxAlternativeINIMode_CheckedChanged); // + // checkBoxAutoSignin + // + this.checkBoxAutoSignin.AutoSize = true; + this.checkBoxAutoSignin.Location = new System.Drawing.Point(12, 176); + this.checkBoxAutoSignin.Name = "checkBoxAutoSignin"; + this.checkBoxAutoSignin.Size = new System.Drawing.Size(121, 17); + this.checkBoxAutoSignin.TabIndex = 20; + this.checkBoxAutoSignin.Text = "Automatically sign-in"; + this.toolTip.SetToolTip(this.checkBoxAutoSignin, "Enabling this will skip the login prompt if you provide your login credentials.\r\n" + + "\r\nAffected values: bAutoSignin\r\nAffected files: Fallout76Custom.ini"); + this.checkBoxAutoSignin.UseVisualStyleBackColor = true; + // // timerCheckFiles // this.timerCheckFiles.Interval = 5000; @@ -3506,6 +3518,7 @@ private void InitializeComponent() this.checkBoxDisableSteam.Size = new System.Drawing.Size(94, 17); this.checkBoxDisableSteam.TabIndex = 6; this.checkBoxDisableSteam.Text = "Disable Steam"; + this.toolTip.SetToolTip(this.checkBoxDisableSteam, "Affected values: bSteamEnabled\r\nAffected files: Fallout76Custom.ini"); this.checkBoxDisableSteam.UseVisualStyleBackColor = true; // // labelCredentialsExplanation @@ -5326,18 +5339,6 @@ private void InitializeComponent() this.pictureBoxLoadingGIF.TabStop = false; this.pictureBoxLoadingGIF.Visible = false; // - // checkBoxAutoSignin - // - this.checkBoxAutoSignin.AutoSize = true; - this.checkBoxAutoSignin.Location = new System.Drawing.Point(12, 176); - this.checkBoxAutoSignin.Name = "checkBoxAutoSignin"; - this.checkBoxAutoSignin.Size = new System.Drawing.Size(121, 17); - this.checkBoxAutoSignin.TabIndex = 20; - this.checkBoxAutoSignin.Text = "Automatically sign-in"; - this.toolTip.SetToolTip(this.checkBoxAutoSignin, "Enabling this will skip the login prompt if you provide your login credentials.\r\n" + - "\r\nAffected values: bAutoSignin\r\nAffected files: Fallout76Custom.ini"); - this.checkBoxAutoSignin.UseVisualStyleBackColor = true; - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/Fo76ini/languages/de-DE.xml b/Fo76ini/languages/de-DE.xml index aca00d3..889833b 100644 --- a/Fo76ini/languages/de-DE.xml +++ b/Fo76ini/languages/de-DE.xml @@ -1,5 +1,5 @@  - + @@ -443,6 +443,12 @@ Betroffene Dateien: Fallout76Custom.ini + + Wenn dies aktiv ist, wird die Anmeldeaufforderung übersprungen, wenn die Anmeldedaten angeben sind. + +Betroffene Werte: bAutoSignin +Betroffene Dateien: Fallout76Custom.ini + @@ -452,7 +458,10 @@ Betroffene Dateien: Fallout76Custom.ini