change these to using var
This commit is contained in:
parent
b687dea1b0
commit
339994c5a7
|
@ -185,8 +185,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void CallSaveStateEvent(string name)
|
||||
{
|
||||
using (GuiAPI.ThisIsTheLuaAutoUnlockHack())
|
||||
{
|
||||
using var luaAutoUnlockHack = GuiAPI.ThisIsTheLuaAutoUnlockHack();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var lf in RegisteredFunctions.Where(static l => l.Event == NamedLuaFunction.EVENT_TYPE_SAVESTATE).ToList())
|
||||
|
@ -199,12 +199,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
LogToLuaConsole($"error running function attached by lua function event.onsavestate\nError message: {e.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CallLoadStateEvent(string name)
|
||||
{
|
||||
using (GuiAPI.ThisIsTheLuaAutoUnlockHack())
|
||||
{
|
||||
using var luaAutoUnlockHack = GuiAPI.ThisIsTheLuaAutoUnlockHack();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var lf in RegisteredFunctions.Where(static l => l.Event == NamedLuaFunction.EVENT_TYPE_LOADSTATE).ToList())
|
||||
|
@ -217,14 +216,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
LogToLuaConsole($"error running function attached by lua function event.onloadstate\nError message: {e.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CallFrameBeforeEvent()
|
||||
{
|
||||
if (IsUpdateSupressed) return;
|
||||
|
||||
using (GuiAPI.ThisIsTheLuaAutoUnlockHack())
|
||||
{
|
||||
using var luaAutoUnlockHack = GuiAPI.ThisIsTheLuaAutoUnlockHack();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var lf in RegisteredFunctions.Where(static l => l.Event == NamedLuaFunction.EVENT_TYPE_PREFRAME).ToList())
|
||||
|
@ -237,14 +235,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
LogToLuaConsole($"error running function attached by lua function event.onframestart\nError message: {e.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CallFrameAfterEvent()
|
||||
{
|
||||
if (IsUpdateSupressed) return;
|
||||
|
||||
using (GuiAPI.ThisIsTheLuaAutoUnlockHack())
|
||||
{
|
||||
using var luaAutoUnlockHack = GuiAPI.ThisIsTheLuaAutoUnlockHack();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var lf in RegisteredFunctions.Where(static l => l.Event == NamedLuaFunction.EVENT_TYPE_POSTFRAME).ToList())
|
||||
|
@ -257,12 +254,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
LogToLuaConsole($"error running function attached by lua function event.onframeend\nError message: {e.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CallExitEvent(LuaFile lf)
|
||||
{
|
||||
using (GuiAPI.ThisIsTheLuaAutoUnlockHack())
|
||||
{
|
||||
using var luaAutoUnlockHack = GuiAPI.ThisIsTheLuaAutoUnlockHack();
|
||||
|
||||
foreach (var exitCallback in RegisteredFunctions
|
||||
.Where(l => l.Event == NamedLuaFunction.EVENT_TYPE_ENGINESTOP
|
||||
&& (l.LuaFile.Path == lf.Path || ReferenceEquals(l.LuaFile.Thread, lf.Thread)))
|
||||
|
@ -271,7 +267,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
exitCallback.Call();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
|
@ -326,10 +321,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _lua.DoString(command);
|
||||
|
||||
public (bool WaitForFrame, bool Terminated) ResumeScript(LuaFile lf)
|
||||
{
|
||||
using (GuiAPI.ThisIsTheLuaAutoUnlockHack())
|
||||
{
|
||||
_currThread = lf.Thread;
|
||||
using var luaAutoUnlockHack = GuiAPI.ThisIsTheLuaAutoUnlockHack();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -353,7 +347,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
LuaLibraryBase.ClearCurrentThread();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Print(params object[] outputs)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue