Revert transformPoint* changes, add transformPoint, delegate all three
This commit is contained in:
parent
6edcd00431
commit
0437de604b
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
||||
|
@ -361,30 +362,25 @@ namespace BizHawk.Client.EmuHawk
|
|||
MainForm.TogglePause();
|
||||
}
|
||||
|
||||
//couldn't make this work..
|
||||
//[LuaMethodExample("local inclitra = client.transformPoint( 32, 100 );")]
|
||||
//[LuaMethod("transformPoint", "Transforms a point in emulator space to a point in client space")]
|
||||
//public static object TransformPoint(int x, int y)
|
||||
//{
|
||||
// var point = new System.Drawing.Point(x, y);
|
||||
// return GlobalWin.DisplayManager.TransformPoint(point);
|
||||
//}
|
||||
|
||||
[LuaMethodExample("local inclitra = client.transformPointX( 16, 100 );")]
|
||||
[LuaMethod("transformPointX", "Transforms a point in emulator space to an x-coordinate in client space")]
|
||||
public static int TransformPointX(int x, int y)
|
||||
{
|
||||
var point = new System.Drawing.Point(x, y);
|
||||
return GlobalWin.DisplayManager.TransformPoint(point).X;
|
||||
[LuaMethodExample("local newPoint = client.transformPoint( 32, 100 );")]
|
||||
[LuaMethod("transformPoint", "Transforms a point 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();
|
||||
table["x"] = transformed.X;
|
||||
table["y"] = transformed.Y;
|
||||
return table;
|
||||
}
|
||||
|
||||
[LuaMethodExample("local inclitra = client.transformPointY( 16, 100 );")]
|
||||
[LuaMethod("transformPointY", "Transforms a point in emulator space to a y-coordinate in client space")]
|
||||
public static int TransformPointY(int x, int y)
|
||||
{
|
||||
var point = new System.Drawing.Point(x, y);
|
||||
return GlobalWin.DisplayManager.TransformPoint(point).Y;
|
||||
}
|
||||
#pragma warning disable CS0612
|
||||
[LuaMethodExample("local inclitra = client.transformPointX( 16 );")]
|
||||
[LuaMethod("transformPointX", "Transforms an x-coordinate in emulator space to an x-coordinate in client space")]
|
||||
public static int TransformPointX(int x) => ClientApi.TransformPointX(x);
|
||||
|
||||
[LuaMethodExample("local inclitra = client.transformPointY( 32 );")]
|
||||
[LuaMethod("transformPointY", "Transforms an y-coordinate in emulator space to an y-coordinate in client space")]
|
||||
public static int TransformPointY(int y) => ClientApi.TransformPointY(y);
|
||||
#pragma warning restore CS0612
|
||||
|
||||
[LuaMethodExample("client.unpause( );")]
|
||||
[LuaMethod("unpause", "Unpauses the emulator")]
|
||||
|
|
Loading…
Reference in New Issue