Skip to content

Commit

Permalink
Improve Lua error message verbosity, document DrawEllipse failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurumaker72 committed Oct 24, 2023
1 parent 40eafd9 commit cae6c91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion M64RPFW.ViewModels/Scripting/Extensions/LuaExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static void GuardedCall(this LuaFunction function, Lua lua)
catch (LuaScriptException e)
{
// trying to call lua.State.Error here throws another exception lol
lua.DoString($"print('{Escape(e.Message)}')");
lua.DoString($"print('{Escape($"{e.Source} {e.Message}")}')");
}
}

Expand Down
4 changes: 4 additions & 0 deletions M64RPFW.ViewModels/Scripting/LuaEnvironment_D2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ private void FillEllipse(float x, float y, float radiusX, float radiusY, float r
private void DrawEllipse(float x, float y, float radiusX, float radiusY, float red, float green, float blue,
float alpha, float thickness)
{
// FIXME: this needs a workaround, as stroke-only ovals are seemingly not supported?
// maybe use a path
#if false
using var paint = new SKPaint
{
Color = SkiaExtensions.ColorFromFloats(red, green, blue, alpha),
Style = SKPaintStyle.Stroke,
StrokeWidth = thickness
};
_skCanvas?.DrawOval(x, y, radiusX, radiusY, paint);
#endif
}

[LibFunction("d2d.draw_line")]
Expand Down

0 comments on commit cae6c91

Please sign in to comment.