Pass log callback through to `LuaPictureBox`

This commit is contained in:
YoshiRulz 2024-08-25 16:38:48 +10:00
parent b51bb85c82
commit f6cb86fa65
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 6 additions and 3 deletions

View File

@ -305,7 +305,7 @@ namespace BizHawk.Client.EmuHawk
return 0;
}
LuaPictureBox pictureBox = new(_th);
LuaPictureBox pictureBox = new(_th, LogOutputCallback);
form.Controls.Add(pictureBox);
const string FUNC_NAME = "forms.pictureBox";
ProcessPositionArguments(x: x, y: y, pictureBox, functionName: FUNC_NAME);

View File

@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk
}
}
luaPictureBox = new(_th)
luaPictureBox = new(_th, LogOutputCallback)
{
Image = Properties.Resources.LuaPictureBox,
Location = new Point(0, 0),

View File

@ -17,6 +17,8 @@ namespace BizHawk.Client.EmuHawk
private readonly Dictionary<Color, SolidBrush> _solidBrushes = new Dictionary<Color, SolidBrush>();
private readonly Dictionary<Color, Pen> _pens = new Dictionary<Color, Pen>();
private readonly Action<string> LogOutputCallback;
private readonly NLuaTableHelper TableHelper;
private SolidBrush GetBrush([LuaColorParam] object color)
@ -29,9 +31,10 @@ namespace BizHawk.Client.EmuHawk
private Color? _defaultBackground;
private Color? _defaultTextBackground = Color.FromArgb(128, 0, 0, 0);
public LuaPictureBox(NLuaTableHelper tableHelper)
public LuaPictureBox(NLuaTableHelper tableHelper, Action<string> logOutputCallback)
{
Image = new Bitmap(Width, Height);
LogOutputCallback = logOutputCallback;
TableHelper = tableHelper;
}