Rename new Lua function by convention, fix ClientApi.TransformPoint
I doubt this ever worked. The Lua one wasn't delegated, it directly accessed GlobalWin, so it didn't have this bug.
This commit is contained in:
parent
00471ac530
commit
6571f70283
|
@ -666,12 +666,12 @@ namespace BizHawk.Client.ApiHawk
|
|||
|
||||
public static Point TransformPoint(Point point)
|
||||
{
|
||||
Type t = ClientAssembly.GetType("BizHawk.Client.EmuHawk.GlobalWin");
|
||||
FieldInfo f = t.GetField("DisplayManager");
|
||||
object displayManager = f.GetValue(null);
|
||||
MethodInfo m = t.GetMethod("TransFormPoint");
|
||||
point = (System.Drawing.Point)m.Invoke(displayManager, new object[] { point });
|
||||
return point;
|
||||
var globalWinType = ClientAssembly.GetType("BizHawk.Client.EmuHawk.GlobalWin");
|
||||
var dispManType = ClientAssembly.GetType("BizHawk.Client.EmuHawk.DisplayManager");
|
||||
var dispManInstance = globalWinType.GetField("DisplayManager").GetValue(null);
|
||||
var transformed = dispManType.GetMethod("TransformPoint")?.Invoke(dispManInstance, new object[] { point });
|
||||
if (transformed is Point p) return p;
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
|
|
|
@ -362,8 +362,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
MainForm.TogglePause();
|
||||
}
|
||||
|
||||
[LuaMethodExample("local newPoint = client.transformPoint( 32, 100 );")]
|
||||
[LuaMethod("transformPoint", "Transforms a point in emulator space to a point in client space")]
|
||||
[LuaMethodExample("local newY = client.transform_point( 32, 100 ).y;")]
|
||||
[LuaMethod("transform_point", "Transforms a point (x, y) in emulator space to a point in client space")]
|
||||
public LuaTable TransformPoint(int x, int y) {
|
||||
var transformed = ClientApi.TransformPoint(new Point(x, y));
|
||||
var table = Lua.NewTable();
|
||||
|
|
Loading…
Reference in New Issue