From ad6bca999a32f53ae891f5ea349981bc2a1d08a5 Mon Sep 17 00:00:00 2001 From: Nikita Krapivin Date: Sun, 15 Aug 2021 21:14:09 +0500 Subject: [PATCH] Update for latest IDE. --- Properties/AssemblyInfo.cs | 4 ++-- ZplGmlfmtPlugin.csproj | 9 ++++----- ZplGmlfmtPluginPreferences.cs | 22 ++++++++++++++-------- ZplGmlfmtPluginStrings.csv | 4 +++- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 7c7224f..a8f51af 100644 --- a/Properties/AssemblyInfo.cs +++ b/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.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.2.0.0")] +[assembly: AssemblyFileVersion("1.2.0.0")] diff --git a/ZplGmlfmtPlugin.csproj b/ZplGmlfmtPlugin.csproj index ccf99b8..9c1a999 100644 --- a/ZplGmlfmtPlugin.csproj +++ b/ZplGmlfmtPlugin.csproj @@ -33,16 +33,15 @@ - ..\..\..\..\Games\Steam\steamapps\common\GameMaker Studio 2 Desktop\IDE.dll + ..\..\..\Progs\GameMakerStudio\23\IDE\IDE.dll - - False - ..\..\..\..\Games\Steam\steamapps\common\GameMaker Studio 2 Desktop\OSCore.dll + + ..\..\..\Progs\GameMakerStudio\23\IDE\OSCore.dll - ..\..\..\..\Games\Steam\steamapps\common\GameMaker Studio 2 Desktop\Utils.dll + ..\..\..\Progs\GameMakerStudio\23\IDE\Utils.dll diff --git a/ZplGmlfmtPluginPreferences.cs b/ZplGmlfmtPluginPreferences.cs index 6f5910c..9986962 100644 --- a/ZplGmlfmtPluginPreferences.cs +++ b/ZplGmlfmtPluginPreferences.cs @@ -1,4 +1,5 @@ -using System.ComponentModel; +using System; +using System.ComponentModel; using System.Runtime.CompilerServices; using YoYoStudio.Core.Utils.Preferences; @@ -15,11 +16,11 @@ public class ZplGmlfmtPluginPreferences : INotifyPropertyChanged private string _GmlfmtPath; private bool _RunGmlfmtOnSave; - [Prefs("machine.Plugins.ZplGmlfmtPlugin.GmlfmtPath", 0, "The path to the gml_fmt executable.", "ZplGmlfmt_Path", ePrefType.text_filename, new object[] { })] - public string GmlfmtPath { get { return _GmlfmtPath; } set { SetProperty(ref _GmlfmtPath, value); } } + [Prefs("machine.Plugins.ZplGmlfmtPlugin.GmlfmtPath", 0, "The path to the gml_fmt executable.", "ZplGmlfmt_Path", ePrefType.text_filename, new object[] { "tooltip:ZplGmlfmt_Path_Tooltip" })] + public string GmlfmtPath { get { return _GmlfmtPath; } set { SetPropertyIfChanged(ref _GmlfmtPath, value); } } - [Prefs("machine.Plugins.ZplGmlfmtPlugin.RunOnSave", 10, "Run gml_fmt on every save or not?", "ZplGmlfmt_OnSave", ePrefType.boolean, new object[] { })] - public bool RunGmlfmtOnSave { get { return _RunGmlfmtOnSave; } set { SetProperty(ref _RunGmlfmtOnSave, value); } } + [Prefs("machine.Plugins.ZplGmlfmtPlugin.RunOnSave", 10, "Run gml_fmt on every save or not?", "ZplGmlfmt_OnSave", ePrefType.boolean, new object[] { "tooltip:ZplGmlfmt_OnSave_Tooltip" })] + public bool RunGmlfmtOnSave { get { return _RunGmlfmtOnSave; } set { SetPropertyIfChanged(ref _RunGmlfmtOnSave, value); } } public ZplGmlfmtPluginPreferences() { @@ -27,10 +28,15 @@ public ZplGmlfmtPluginPreferences() RunGmlfmtOnSave = false; } - private void SetProperty(ref T property, T value, [CallerMemberName] string propertyName = "") + private void SetPropertyIfChanged(ref T property, T value, [CallerMemberName] string propertyName = "") { - property = value; - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + var isEqual = property != null && ((IEquatable)property).Equals(value); + + if (!isEqual) + { + property = value; + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } } } } diff --git a/ZplGmlfmtPluginStrings.csv b/ZplGmlfmtPluginStrings.csv index a6519af..04f68f8 100644 --- a/ZplGmlfmtPluginStrings.csv +++ b/ZplGmlfmtPluginStrings.csv @@ -7,6 +7,8 @@ ZGFP_Path,Path to the gml_fmt executable is not set or invalid.,Path to the gml_ ZGFP_Project,Project path is invalid.,Project path is invalid.,,messagebox project body ZplGmlfmtPlugin,gml_fmt,gml_fmt,,preferences title ZplGmlfmt_Path,Path to the gml_fmt executable,Path to the gml_fmt executable,,settings title +ZplGmlfmt_Path_Tooltip,Make sure the build you choose is compatible with 2.3 projects!,,tooltip when you hover over the path box ZplGmlfmt_OnSave,Run gml_fmt after every project save?,Run gml_fmt after every project save?,,settings title no2 +ZplGmlfmt_OnSave_Tooltip,Enabling this feature may annoy you due to buggy FileWatcher.,,tooltip when you hover on the onsave checkbox ZGFP_MenuBar_Title,gml_fmt,gml_fmt,,menubar title -ZGFP_MenuBar_Run,Run the tool,Run the tool,,menubar button \ No newline at end of file +ZGFP_MenuBar_Run,Run the tool,Run the tool,,menubar button