From c25223ae1b683a0638d2ae0217cfa7d1f3de02a0 Mon Sep 17 00:00:00 2001 From: Victor Chelaru Date: Mon, 15 Jan 2024 06:37:51 -0700 Subject: [PATCH 1/2] Linking to source on projects in different directory now properly works Create Plugin Window now appears at the cursor position. --- FRBDK/Glue/Glue/Controls/CreatePluginWindow.xaml.cs | 8 ++++++++ FRBDK/Glue/Glue/VSHelpers/VSSolution.cs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/FRBDK/Glue/Glue/Controls/CreatePluginWindow.xaml.cs b/FRBDK/Glue/Glue/Controls/CreatePluginWindow.xaml.cs index 3c298695c..e6890640a 100644 --- a/FRBDK/Glue/Glue/Controls/CreatePluginWindow.xaml.cs +++ b/FRBDK/Glue/Glue/Controls/CreatePluginWindow.xaml.cs @@ -10,6 +10,7 @@ using System.Windows.Forms; using L = Localization; using MessageBox = System.Windows.Forms.MessageBox; +using GlueFormsCore.Extensions; namespace FlatRedBall.Glue.Controls; @@ -36,6 +37,13 @@ public CreatePluginWindow() FillInstalledPluginComboBox(); UpdateToSelectedSource(); + + Loaded += HandleLoaded; + } + + private void HandleLoaded(object sender, RoutedEventArgs e) + { + this.MoveToCursor(); } #region Methods diff --git a/FRBDK/Glue/Glue/VSHelpers/VSSolution.cs b/FRBDK/Glue/Glue/VSHelpers/VSSolution.cs index fc835e986..7d9de07dc 100644 --- a/FRBDK/Glue/Glue/VSHelpers/VSSolution.cs +++ b/FRBDK/Glue/Glue/VSHelpers/VSSolution.cs @@ -33,7 +33,7 @@ public static bool AddExistingProjectWithDotNet(FilePath solution, FilePath proj var startInfo = new ProcessStartInfo { FileName = "dotnet.exe", - Arguments = $"sln \"{solution.FullPath}\" add \"{project.FullPath}\"", + Arguments = $"sln \"{solution.FullPath}\" add \"{project.FullPath.Replace("/", "\\")}\" --in-root", CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardOutput = true, From 49e7349b7a344a2dbef701efabb1b31aca6590da Mon Sep 17 00:00:00 2001 From: Victor Chelaru Date: Mon, 15 Jan 2024 19:28:00 -0700 Subject: [PATCH 2/2] Added CanBeSetInFile property to VariableDefinitions. --- FRBDK/Glue/GlueCommon/SaveClasses/VariableDefinition.cs | 2 ++ .../OfficialPlugins/PropertyGrid/MainPropertyGridPlugin.cs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/FRBDK/Glue/GlueCommon/SaveClasses/VariableDefinition.cs b/FRBDK/Glue/GlueCommon/SaveClasses/VariableDefinition.cs index 5486493fb..012197430 100644 --- a/FRBDK/Glue/GlueCommon/SaveClasses/VariableDefinition.cs +++ b/FRBDK/Glue/GlueCommon/SaveClasses/VariableDefinition.cs @@ -73,6 +73,8 @@ public class VariableDefinition [JsonIgnore] public Func> CustomGetForcedOptionFunc; + // Added Jan 15 2024, default to true to match behavior + public bool CanBeSetInFile = true; public bool HasGetter { get; set; } = true; diff --git a/FRBDK/Glue/OfficialPlugins/PropertyGrid/MainPropertyGridPlugin.cs b/FRBDK/Glue/OfficialPlugins/PropertyGrid/MainPropertyGridPlugin.cs index 66c084297..e2ac489b4 100644 --- a/FRBDK/Glue/OfficialPlugins/PropertyGrid/MainPropertyGridPlugin.cs +++ b/FRBDK/Glue/OfficialPlugins/PropertyGrid/MainPropertyGridPlugin.cs @@ -244,7 +244,10 @@ private void HandleNamedObjectSelect(NamedObjectSave namedObject, GlueElement cu } foreach(var variable in ati.VariableDefinitions) { - variable.DefaultValue = null; + if(variable.CanBeSetInFile == false) + { + variable.DefaultValue = null; + } } }