From 069bf5795fbf127d2a8c3233988a77aa7b2107d7 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sun, 4 Apr 2021 23:14:39 -0700 Subject: Fix most errors from wrapper rewrite --- grapher/Models/Options/ApplyOptions.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'grapher/Models/Options/ApplyOptions.cs') diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index ffe430d..43a2da8 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -108,19 +108,17 @@ namespace grapher.Models.Options double xSens, double ySens, double rotation, - int xMode, - int yMode, AccelArgs xArgs, AccelArgs yArgs, bool isWhole) { Sensitivity.SetActiveValues(xSens, ySens); Rotation.SetActiveValue(rotation); - OptionSetX.SetActiveValues(xMode, xArgs); + OptionSetX.SetActiveValues(xArgs); WholeVectorCheckBox.Checked = isWhole; ByComponentVectorCheckBox.Checked = !isWhole; ByComponentVectorXYLock.Checked = xArgs.Equals(yArgs); - OptionSetY.SetActiveValues(yMode, yArgs); + OptionSetY.SetActiveValues(yArgs); } public void SetActiveValues(DriverSettings settings) @@ -129,8 +127,6 @@ namespace grapher.Models.Options settings.sensitivity.x, settings.sensitivity.y, settings.rotation, - (int)settings.modes.x, - (int)settings.modes.y, settings.args.x, settings.args.y, settings.combineMagnitudes); -- cgit v1.2.3 From a6926be0e911b7b7637861866f41c3bca31a87a3 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Tue, 13 Apr 2021 23:59:21 -0400 Subject: move arbitrary input into settings separate arbitrary mode from spaced modes, arbitrary now deserializes from default settings file --- grapher/Models/Options/ApplyOptions.cs | 57 ++++++++++------------------------ 1 file changed, 16 insertions(+), 41 deletions(-) (limited to 'grapher/Models/Options/ApplyOptions.cs') diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 43a2da8..06854b8 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -81,55 +81,30 @@ namespace grapher.Models.Options #region Methods - public Vec2 GetModes() + public void SetArgs(ref Vec2 args) { - var xMode = (AccelMode)OptionSetX.Options.AccelerationIndex; + OptionSetX.SetArgs(ref args.x); - return new Vec2 + if (ByComponentVectorXYLock.Checked) { - x = xMode, - y = ByComponentVectorXYLock.Checked ? xMode : (AccelMode)OptionSetY.Options.AccelerationIndex - }; - } - - public Vec2 GetArgs() - { - var xArgs = OptionSetX.GenerateArgs(); - - return new Vec2 + OptionSetX.SetArgs(ref args.y); + } + else { - x = xArgs, - y = ByComponentVectorXYLock.Checked ? xArgs : OptionSetY.GenerateArgs() - }; - - } - - public void SetActiveValues( - double xSens, - double ySens, - double rotation, - AccelArgs xArgs, - AccelArgs yArgs, - bool isWhole) - { - Sensitivity.SetActiveValues(xSens, ySens); - Rotation.SetActiveValue(rotation); - OptionSetX.SetActiveValues(xArgs); - WholeVectorCheckBox.Checked = isWhole; - ByComponentVectorCheckBox.Checked = !isWhole; - ByComponentVectorXYLock.Checked = xArgs.Equals(yArgs); - OptionSetY.SetActiveValues(yArgs); + OptionSetY.SetArgs(ref args.y); + } } public void SetActiveValues(DriverSettings settings) { - SetActiveValues( - settings.sensitivity.x, - settings.sensitivity.y, - settings.rotation, - settings.args.x, - settings.args.y, - settings.combineMagnitudes); + Sensitivity.SetActiveValues(settings.sensitivity.x, settings.sensitivity.y); + Rotation.SetActiveValue(settings.rotation); + + WholeVectorCheckBox.Checked = settings.combineMagnitudes; + ByComponentVectorCheckBox.Checked = !settings.combineMagnitudes; + ByComponentVectorXYLock.Checked = settings.args.x.Equals(settings.args.y); + OptionSetX.SetActiveValues(ref settings.args.x); + OptionSetY.SetActiveValues(ref settings.args.y); Directionality.SetActiveValues(settings); -- cgit v1.2.3