Lua Functions list - make params look pretty, including strongly typed variables when possible
This commit is contained in:
parent
70feebf229
commit
853c82d111
|
@ -63,20 +63,9 @@ namespace BizHawk.Client.Common
|
|||
"displayvsync",
|
||||
"Sets the display vsync property of the emulator"
|
||||
)]
|
||||
public static void DisplayVsync(object boolean)
|
||||
public static void DisplayVsync(bool enabled)
|
||||
{
|
||||
var temp = boolean.ToString();
|
||||
if (!String.IsNullOrWhiteSpace(temp))
|
||||
{
|
||||
if (temp == "0" || temp.ToLower() == "false")
|
||||
{
|
||||
Global.Config.VSyncThrottle = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Global.Config.VSyncThrottle = true;
|
||||
}
|
||||
}
|
||||
Global.Config.VSyncThrottle = enabled;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
|
|
@ -83,17 +83,21 @@ namespace BizHawk.Client.Common
|
|||
list.Append('(');
|
||||
for (var i = 0; i < Parameters.Count; i++)
|
||||
{
|
||||
var param = Parameters[i]
|
||||
.Replace("System", String.Empty)
|
||||
.Replace("Object", String.Empty)
|
||||
.Replace(" ", String.Empty)
|
||||
.Replace(".", String.Empty)
|
||||
.Replace("LuaInterface", String.Empty);
|
||||
var param =
|
||||
Parameters[i].Replace("System", String.Empty)
|
||||
.Replace("Object", String.Empty)
|
||||
.Replace(" ", String.Empty)
|
||||
.Replace(".", String.Empty)
|
||||
.Replace("LuaInterface", String.Empty)
|
||||
.Replace("Boolean", "bool ")
|
||||
.Replace("String", "string ")
|
||||
.Replace("LuaTable", "table ")
|
||||
.Replace("LuaFunction", "func ");
|
||||
|
||||
list.Append(param);
|
||||
if (i < Parameters.Count - 1)
|
||||
{
|
||||
list.Append(',');
|
||||
list.Append(", ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue