diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.String.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.String.cs index bdc5d82275..225d3c7b6b 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.String.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.String.cs @@ -65,7 +65,7 @@ namespace BizHawk.Client.Common } [LuaMethodExample("local stbizrep = bizstring.replace( \"Some string\", \"Some\", \"Replaced\" );")] - [LuaMethod("replace", "Returns a string that replaces all occurances of str2 in str1 with the value of replace")] + [LuaMethod("replace", "Returns a string that replaces all occurrences of str2 in str1 with the value of replace")] public static string Replace(string str, string str2, string replace) { return string.IsNullOrEmpty(str) diff --git a/BizHawk.Client.Common/lua/LuaDocumentation.cs b/BizHawk.Client.Common/lua/LuaDocumentation.cs index bf29edf54e..dc81b3e5d4 100644 --- a/BizHawk.Client.Common/lua/LuaDocumentation.cs +++ b/BizHawk.Client.Common/lua/LuaDocumentation.cs @@ -122,14 +122,9 @@ __Types and notation__ .Append(i + 1) .Append(":"); - if (parameters[i].IsOptional) - { - sb.Append($"[{parameters[i].Name}]"); - } - else - { - sb.Append(parameters[i].Name); - } + sb.Append(parameters[i].IsOptional + ? $"[{parameters[i].Name}]" + : parameters[i].Name); sb.Append("}"); diff --git a/BizHawk.Client.Common/lua/LuaLibraryBase.cs b/BizHawk.Client.Common/lua/LuaLibraryBase.cs index 6ecf3baec4..fde7af97e7 100644 --- a/BizHawk.Client.Common/lua/LuaLibraryBase.cs +++ b/BizHawk.Client.Common/lua/LuaLibraryBase.cs @@ -22,7 +22,7 @@ namespace BizHawk.Client.Common protected static LuaFile CurrentFile { get; private set; } - private static Thread CurrentHostThread; + private static Thread _currentHostThread; private static readonly object ThreadMutex = new object(); public abstract string Name { get; } @@ -33,7 +33,7 @@ namespace BizHawk.Client.Common { lock (ThreadMutex) { - CurrentHostThread = null; + _currentHostThread = null; CurrentFile = null; } } @@ -43,12 +43,12 @@ namespace BizHawk.Client.Common { lock (ThreadMutex) { - if (CurrentHostThread != null) + if (_currentHostThread != null) { throw new InvalidOperationException("Can't have lua running in two host threads at a time!"); } - CurrentHostThread = Thread.CurrentThread; + _currentHostThread = Thread.CurrentThread; CurrentFile = luaFile; } } diff --git a/BizHawk.Client.Common/lua/LuaSandbox.cs b/BizHawk.Client.Common/lua/LuaSandbox.cs index e366027e59..3e82f5c1b7 100644 --- a/BizHawk.Client.Common/lua/LuaSandbox.cs +++ b/BizHawk.Client.Common/lua/LuaSandbox.cs @@ -1,6 +1,6 @@ using System; +using System.Runtime.CompilerServices; using BizHawk.Common; - using NLua; // TODO - evaluate for re-entrancy problems @@ -8,7 +8,7 @@ namespace BizHawk.Client.Common { public unsafe class LuaSandbox { - private static readonly System.Runtime.CompilerServices.ConditionalWeakTable SandboxForThread = new System.Runtime.CompilerServices.ConditionalWeakTable(); + private static readonly ConditionalWeakTable SandboxForThread = new ConditionalWeakTable(); public static Action DefaultLogger { get; set; } @@ -103,7 +103,7 @@ namespace BizHawk.Client.Common public static LuaSandbox GetSandbox(Lua thread) { // this is just placeholder. - // we shouldnt be calling a sandbox with no thread--construct a sandbox properly + // we shouldn't be calling a sandbox with no thread--construct a sandbox properly if (thread == null) { return new LuaSandbox(); diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index bc703b7ac8..111a2e59cc 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -950,7 +950,7 @@ namespace BizHawk.Client.EmuHawk Filter = new FilesystemFilterSet(FilesystemFilter.LuaScripts).ToString() }; - if (sfd.ShowDialog() == DialogResult.OK) + if (sfd.ShowDialog().IsOk()) { string text = File.ReadAllText(script.Path); File.WriteAllText(sfd.FileName, text); diff --git a/BizHawk.sln.DotSettings b/BizHawk.sln.DotSettings index 07918cba7d..10a30ea928 100644 --- a/BizHawk.sln.DotSettings +++ b/BizHawk.sln.DotSettings @@ -185,6 +185,7 @@ True True True + True True True True @@ -214,6 +215,7 @@ True True True + True True True True @@ -340,6 +342,7 @@ True True True + True True True True @@ -375,6 +378,7 @@ True True True + True True True True