Skip to content

Commit a1ccac4

Browse files
committed
Delegate ClientLuaLibrary.FrameSkip to ApiHawk
the ApiHawk copy was the bad one
1 parent 7c85aee commit a1ccac4

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

src/BizHawk.Client.EmuHawk/Api/Libraries/EmuClientApi.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,14 @@ public void DoFrameAdvanceAndUnpause()
130130

131131
public void FrameSkip(int numFrames)
132132
{
133-
if (numFrames > 0)
134-
{
135-
_config.FrameSkip = numFrames;
136-
_mainForm.FrameSkipMessage();
137-
}
138-
else
133+
if (numFrames < 0)
139134
{
140135
_logCallback("Invalid frame skip value");
136+
return;
141137
}
138+
139+
_config.FrameSkip = numFrames;
140+
_mainForm.FrameSkipMessage();
142141
}
143142

144143
private void GetAllInputs()

src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/ClientLuaLibrary.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,7 @@ public int BufferWidth()
7676

7777
[LuaMethodExample("client.frameskip( 8 );")]
7878
[LuaMethod("frameskip", "Sets the frame skip value of the client UI (use 0 to disable)")]
79-
public void FrameSkip(int numFrames)
80-
{
81-
//TODO delegate to APIs.EmuClient (impl uses `> 0` instead of `>= 0`)
82-
if (numFrames >= 0)
83-
{
84-
GlobalWin.Config.FrameSkip = numFrames;
85-
MainForm.FrameSkipMessage();
86-
}
87-
else
88-
{
89-
Log("Invalid frame skip value");
90-
}
91-
}
79+
public void FrameSkip(int numFrames) => APIs.EmuClient.FrameSkip(numFrames);
9280

9381
[LuaMethodExample("client.invisibleemulation( true );")]
9482
[LuaMethod("invisibleemulation", "Disables and enables emulator updates")]

0 commit comments

Comments
 (0)