Skip to content

Commit f6cb86f

Browse files
committed
Pass log callback through to LuaPictureBox
1 parent b51bb85 commit f6cb86f

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public long PictureBox(long formHandle, int? x = null, int? y = null, int? width
305305
return 0;
306306
}
307307

308-
LuaPictureBox pictureBox = new(_th);
308+
LuaPictureBox pictureBox = new(_th, LogOutputCallback);
309309
form.Controls.Add(pictureBox);
310310
const string FUNC_NAME = "forms.pictureBox";
311311
ProcessPositionArguments(x: x, y: y, pictureBox, functionName: FUNC_NAME);

src/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public LuaCanvas(
5656
}
5757
}
5858

59-
luaPictureBox = new(_th)
59+
luaPictureBox = new(_th, LogOutputCallback)
6060
{
6161
Image = Properties.Resources.LuaPictureBox,
6262
Location = new Point(0, 0),

src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public class LuaPictureBox : PictureBox
1717
private readonly Dictionary<Color, SolidBrush> _solidBrushes = new Dictionary<Color, SolidBrush>();
1818
private readonly Dictionary<Color, Pen> _pens = new Dictionary<Color, Pen>();
1919

20+
private readonly Action<string> LogOutputCallback;
21+
2022
private readonly NLuaTableHelper TableHelper;
2123

2224
private SolidBrush GetBrush([LuaColorParam] object color)
@@ -29,9 +31,10 @@ private Pen GetPen([LuaColorParam] object color)
2931
private Color? _defaultBackground;
3032
private Color? _defaultTextBackground = Color.FromArgb(128, 0, 0, 0);
3133

32-
public LuaPictureBox(NLuaTableHelper tableHelper)
34+
public LuaPictureBox(NLuaTableHelper tableHelper, Action<string> logOutputCallback)
3335
{
3436
Image = new Bitmap(Width, Height);
37+
LogOutputCallback = logOutputCallback;
3538
TableHelper = tableHelper;
3639
}
3740

0 commit comments

Comments
 (0)