Skip to content

Commit 668dfd5

Browse files
committed
Build v1.2.0, usability and bug fixes
Script managing is now easier, options form can be opened from a specific webpage, some buttons are colour-coded.
1 parent 6fb9596 commit 668dfd5

16 files changed

+178
-698
lines changed

BHOUserScript/AddScriptFrm.Designer.cs

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BHOUserScript/BHOUserScript.csproj

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,6 @@
133133
</Compile>
134134
<Compile Include="Resources.cs" />
135135
<Compile Include="Script.cs" />
136-
<Compile Include="ScriptDirectoriesFrm.cs">
137-
<SubType>Form</SubType>
138-
</Compile>
139-
<Compile Include="ScriptDirectoriesFrm.Designer.cs">
140-
<DependentUpon>ScriptDirectoriesFrm.cs</DependentUpon>
141-
</Compile>
142136
<Compile Include="ScriptEditFrm.cs">
143137
<SubType>Form</SubType>
144138
</Compile>
@@ -194,9 +188,6 @@
194188
<EmbeddedResource Include="ReadSettingsFailureFrm.resx">
195189
<DependentUpon>ReadSettingsFailureFrm.cs</DependentUpon>
196190
</EmbeddedResource>
197-
<EmbeddedResource Include="ScriptDirectoriesFrm.resx">
198-
<DependentUpon>ScriptDirectoriesFrm.cs</DependentUpon>
199-
</EmbeddedResource>
200191
<EmbeddedResource Include="ScriptEditFrm.resx">
201192
<DependentUpon>ScriptEditFrm.cs</DependentUpon>
202193
</EmbeddedResource>
@@ -209,11 +200,15 @@
209200
<ItemGroup />
210201
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
211202
<PropertyGroup>
212-
<PostBuildEvent>"C:\Program Files\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" /f /i "$(TargetDir)$(TargetFileName)"
203+
<PostBuildEvent>"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" /f /i "$(TargetDir)$(TargetFileName)"
213204

214205
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" /unregister "$(TargetDir)$(TargetFileName)"
215206

216-
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "$(TargetDir)$(TargetFileName)"</PostBuildEvent>
207+
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "$(TargetDir)$(TargetFileName)"
208+
209+
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe" /unregister "$(TargetDir)$(TargetFileName)"
210+
211+
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe" "$(TargetDir)$(TargetFileName)"</PostBuildEvent>
217212
</PropertyGroup>
218213
<PropertyGroup>
219214
<PreBuildEvent>

BHOUserScript/Options.Designer.cs

Lines changed: 25 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BHOUserScript/Options.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Diagnostics;
3+
using System.IO;
34
using System.Windows.Forms;
45

56
namespace BHOUserScript
@@ -74,13 +75,20 @@ private void addBtn_Click(object sender, EventArgs e)
7475
Prefs.AllScripts.Add(sw.EditedScript);
7576
RefreshList();
7677
}
78+
else
79+
{
80+
// If file was selected and then form cancelled delete file
81+
if (sw.fileTxt.Text != "" && File.Exists(Scriptmonkey.ScriptPath + sw.fileTxt.Text))
82+
File.Delete(Scriptmonkey.ScriptPath + sw.fileTxt.Text);
83+
}
7784
}
7885

7986
private void removeBtn_Click(object sender, EventArgs e)
8087
{
8188
if (listBox1.SelectedIndex > -1)
8289
{
83-
// Add 'are you sure' dialog (also with options to remove file)
90+
if (File.Exists(Scriptmonkey.ScriptPath + Prefs.AllScripts[listBox1.SelectedIndex].Path))
91+
File.Delete(Scriptmonkey.ScriptPath + Prefs.AllScripts[listBox1.SelectedIndex].Path);
8492
Prefs.AllScripts.RemoveAt(listBox1.SelectedIndex);
8593
eachEnabledChk.Enabled = false;
8694
RefreshList();
@@ -165,5 +173,10 @@ private void button2_Click(object sender, EventArgs e)
165173
}
166174
form.Dispose();
167175
}
176+
177+
private void Options_FormClosed(object sender, FormClosedEventArgs e)
178+
{
179+
DialogResult = DialogResult.OK;
180+
}
168181
}
169182
}

BHOUserScript/ParseScriptMetadata.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ namespace BHOUserScript
99
/// </summary>
1010
static class ParseScriptMetadata
1111
{
12-
static readonly string Name = @"// +@name( |\t)+([a-zA-Z\d :.,/\*_-]+)";
13-
static readonly string Description = @"// +@description( |\t)+([a-zA-Z\d :.,/\*_-]+)";
14-
static readonly string Author = @"// +@author( |\t)+([a-zA-Z\d :.,/\*_-]+)";
15-
static readonly string Version = @"// +@version( |\t)+([a-zA-Z\d :.,/\*_-]+)";
16-
static readonly string Match = @"// +@match( |\t)+([a-zA-Z\d :.,/\*_-]+)";
17-
static readonly string Include = @"// +@include( |\t)+([a-zA-Z\d :.,/\*_-]+)";
18-
static readonly string UpdateUrl = @"// +@updateURL( |\t)+([a-zA-Z\d :.,/\*_-]+)";
12+
static readonly string Name = @"// +@name( |\t)+([a-zA-Z\d :.,/\*_\+\?!-]+)";
13+
static readonly string Description = @"// +@description( |\t)+([a-zA-Z\d :.,/\*_\+\?!-]+)";
14+
static readonly string Author = @"// +@author( |\t)+([a-zA-Z\d :.,/\*_\+\?!-]+)";
15+
static readonly string Version = @"// +@version( |\t)+([a-zA-Z\d :.,/\*_\+\?!-]+)";
16+
static readonly string Match = @"// +@match( |\t)+([a-zA-Z\d :.,/\*_\+\?!-]+)";
17+
static readonly string Include = @"// +@include( |\t)+([a-zA-Z\d :.,/\*_\+\?!-]+)";
18+
static readonly string UpdateUrl = @"// +@updateURL( |\t)+([a-zA-Z\d :.,/\*_\+\?!-]+)";
1919

2020
public static Script Parse(string path)
2121
{

0 commit comments

Comments
 (0)