From f30b99267a473ba6c632235baef72d29c1b95f9a Mon Sep 17 00:00:00 2001 From: Dennis van den Berg Date: Tue, 15 Oct 2019 13:24:20 +0200 Subject: [PATCH] Change defaults and allow the use of confirm on release for Fortnite chapter 2 --- FortEZEdit/App.config | 5 ++++- FortEZEdit/FortEZEditForm.Designer.cs | 14 ++++++++++++++ FortEZEdit/FortEZEditForm.cs | 14 +++++++++++++- FortEZEdit/IntereceptorFacade.cs | 8 +++++++- FortEZEdit/Properties/AssemblyInfo.cs | 4 ++-- FortEZEdit/Properties/Settings.Designer.cs | 16 ++++++++++++++-- FortEZEdit/Properties/Settings.settings | 5 ++++- 7 files changed, 58 insertions(+), 8 deletions(-) diff --git a/FortEZEdit/App.config b/FortEZEdit/App.config index dfd4c83..ed0acc1 100644 --- a/FortEZEdit/App.config +++ b/FortEZEdit/App.config @@ -38,7 +38,7 @@ 1 - Control + F C @@ -49,6 +49,9 @@ Two + + True + \ No newline at end of file diff --git a/FortEZEdit/FortEZEditForm.Designer.cs b/FortEZEdit/FortEZEditForm.Designer.cs index 42e89a1..debdbbc 100644 --- a/FortEZEdit/FortEZEditForm.Designer.cs +++ b/FortEZEdit/FortEZEditForm.Designer.cs @@ -61,6 +61,7 @@ private void InitializeComponent() this.btnFnKeyEdit = new System.Windows.Forms.Button(); this.lblEditKey = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); + this.chkEditToConfirm = new System.Windows.Forms.CheckBox(); this.centerPanel.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numEditRampPlaceReleaseDelay)).BeginInit(); @@ -274,6 +275,7 @@ private void InitializeComponent() // // grpDnR // + this.grpDnR.Controls.Add(this.chkEditToConfirm); this.grpDnR.Controls.Add(this.numReleaseDelay); this.grpDnR.Controls.Add(this.lblReleaseDelay); this.grpDnR.Controls.Add(this.lblHoldDelay); @@ -418,6 +420,17 @@ private void InitializeComponent() this.label2.TabIndex = 0; this.label2.Text = "Ramp key:"; // + // chkEditToConfirm + // + this.chkEditToConfirm.AutoSize = true; + this.chkEditToConfirm.Location = new System.Drawing.Point(168, 24); + this.chkEditToConfirm.Name = "chkEditToConfirm"; + this.chkEditToConfirm.Size = new System.Drawing.Size(121, 17); + this.chkEditToConfirm.TabIndex = 6; + this.chkEditToConfirm.Text = "Press edit to confirm"; + this.chkEditToConfirm.UseVisualStyleBackColor = true; + this.chkEditToConfirm.CheckedChanged += new System.EventHandler(this.changeCheckEvent); + // // FortEZEditForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -490,6 +503,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label3; private System.Windows.Forms.Button btnFnKeyShotgun; private System.Windows.Forms.Label label5; + private System.Windows.Forms.CheckBox chkEditToConfirm; } } diff --git a/FortEZEdit/FortEZEditForm.cs b/FortEZEdit/FortEZEditForm.cs index 33d6cbd..6870d47 100644 --- a/FortEZEdit/FortEZEditForm.cs +++ b/FortEZEdit/FortEZEditForm.cs @@ -89,6 +89,9 @@ private void LoadSettings() btnFnKeyShotgun.Text = Properties.Settings.Default.FnKey_Shotgun.ToString(); settingsSetterMap[btnFnKeyShotgun] = (s) => { Properties.Settings.Default.FnKey_Shotgun = (Interceptor.Keys)s; }; + chkEditToConfirm.Checked = Properties.Settings.Default.Check_EditToConfirm; + settingsSetterMap[chkEditToConfirm] = (s) => { Properties.Settings.Default.Check_EditToConfirm = (bool)s; }; + numMouseId.Value = Properties.Settings.Default.id_Mouse; settingsSetterMap[numMouseId] = (s) => { @@ -173,7 +176,16 @@ private void changeNumEvent(object sender, EventArgs e) settingsSetterMap[changingUpDown].Invoke(Convert.ToInt32(changingUpDown.Value)); LoadSettings(); } - changingUpDown = null; + } + + private void changeCheckEvent(object sender, EventArgs e) + { + CheckBox changingCheckBox = (CheckBox)sender; + if (settingsSetterMap.ContainsKey(changingCheckBox)) + { + settingsSetterMap[changingCheckBox].Invoke(changingCheckBox.Checked); + LoadSettings(); + } } } } diff --git a/FortEZEdit/IntereceptorFacade.cs b/FortEZEdit/IntereceptorFacade.cs index 4f90776..bce4196 100644 --- a/FortEZEdit/IntereceptorFacade.cs +++ b/FortEZEdit/IntereceptorFacade.cs @@ -139,13 +139,19 @@ private void Input_OnKeyPressed(object sender, KeyPressedEventArgs e) // Spin wait } Thread.Sleep(defaultSettings.Delay_DnrClickRelease); - input.SendKey(defaultSettings.FnKey_Edit); + // Confirm the edit + if (defaultSettings.Check_EditToConfirm) + { + input.SendKey(defaultSettings.FnKey_Edit); + } + // If ramp placement is triggered, build the ramp and select shotgun if (triggeredEditRampPlace || isEditRampPlaceModifierDown) { input.SendKey(defaultSettings.FnKey_Ramp); Thread.Sleep(defaultSettings.Delay_ReleaseEditRampPlaceDelay); input.SendKey(defaultSettings.FnKey_Shotgun); } + // Release mouse input.SendMouseEvent(MouseState.LeftUp); isDnRDown = false; triggeredEditRampPlace = false; diff --git a/FortEZEdit/Properties/AssemblyInfo.cs b/FortEZEdit/Properties/AssemblyInfo.cs index 8709bf4..7f9aab3 100644 --- a/FortEZEdit/Properties/AssemblyInfo.cs +++ b/FortEZEdit/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.2.0")] -[assembly: AssemblyFileVersion("1.0.2.0")] +[assembly: AssemblyVersion("1.0.2.1")] +[assembly: AssemblyFileVersion("1.0.2.1")] diff --git a/FortEZEdit/Properties/Settings.Designer.cs b/FortEZEdit/Properties/Settings.Designer.cs index 286bcb2..c648577 100644 --- a/FortEZEdit/Properties/Settings.Designer.cs +++ b/FortEZEdit/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace FortEZEdit.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -133,7 +133,7 @@ public int id_Mouse { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("Control")] + [global::System.Configuration.DefaultSettingValueAttribute("F")] public global::Interceptor.Keys Key_EditRampPlaceModifier { get { return ((global::Interceptor.Keys)(this["Key_EditRampPlaceModifier"])); @@ -178,5 +178,17 @@ public int Delay_ReleaseEditRampPlaceDelay { this["FnKey_Shotgun"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Check_EditToConfirm { + get { + return ((bool)(this["Check_EditToConfirm"])); + } + set { + this["Check_EditToConfirm"] = value; + } + } } } diff --git a/FortEZEdit/Properties/Settings.settings b/FortEZEdit/Properties/Settings.settings index 8bde262..168339b 100644 --- a/FortEZEdit/Properties/Settings.settings +++ b/FortEZEdit/Properties/Settings.settings @@ -30,7 +30,7 @@ 1 - Control + F C @@ -41,5 +41,8 @@ Two + + True + \ No newline at end of file