Skip to content

Commit

Permalink
Update for latest IDE.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrapivin committed Aug 15, 2021
1 parent 519ddb3 commit ad6bca9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
9 changes: 4 additions & 5 deletions ZplGmlfmtPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="IDE">
<HintPath>..\..\..\..\Games\Steam\steamapps\common\GameMaker Studio 2 Desktop\IDE.dll</HintPath>
<HintPath>..\..\..\Progs\GameMakerStudio\23\IDE\IDE.dll</HintPath>
</Reference>
<Reference Include="OSCore, Version=2.3.2.560, Culture=neutral, PublicKeyToken=83c29ed24e39e35e, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Games\Steam\steamapps\common\GameMaker Studio 2 Desktop\OSCore.dll</HintPath>
<Reference Include="OSCore">
<HintPath>..\..\..\Progs\GameMakerStudio\23\IDE\OSCore.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.XML" />
<Reference Include="Utils">
<HintPath>..\..\..\..\Games\Steam\steamapps\common\GameMaker Studio 2 Desktop\Utils.dll</HintPath>
<HintPath>..\..\..\Progs\GameMakerStudio\23\IDE\Utils.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
22 changes: 14 additions & 8 deletions ZplGmlfmtPluginPreferences.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.ComponentModel;
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using YoYoStudio.Core.Utils.Preferences;

Expand All @@ -15,22 +16,27 @@ 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()
{
GmlfmtPath = "";
RunGmlfmtOnSave = false;
}

private void SetProperty<T>(ref T property, T value, [CallerMemberName] string propertyName = "")
private void SetPropertyIfChanged<T>(ref T property, T value, [CallerMemberName] string propertyName = "")
{
property = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
var isEqual = property != null && ((IEquatable<T>)property).Equals(value);

if (!isEqual)
{
property = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion ZplGmlfmtPluginStrings.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
ZGFP_MenuBar_Run,Run the tool,Run the tool,,menubar button

0 comments on commit ad6bca9

Please sign in to comment.