Lua Functions list - make params look pretty, including strongly typed variables when possible

This commit is contained in:
adelikat 2014-01-26 20:05:45 +00:00
parent 70feebf229
commit 853c82d111
2 changed files with 13 additions and 20 deletions

View File

@ -63,20 +63,9 @@ namespace BizHawk.Client.Common
"displayvsync", "displayvsync",
"Sets the display vsync property of the emulator" "Sets the display vsync property of the emulator"
)] )]
public static void DisplayVsync(object boolean) public static void DisplayVsync(bool enabled)
{ {
var temp = boolean.ToString(); Global.Config.VSyncThrottle = enabled;
if (!String.IsNullOrWhiteSpace(temp))
{
if (temp == "0" || temp.ToLower() == "false")
{
Global.Config.VSyncThrottle = false;
}
else
{
Global.Config.VSyncThrottle = true;
}
}
} }
[LuaMethodAttributes( [LuaMethodAttributes(

View File

@ -83,17 +83,21 @@ namespace BizHawk.Client.Common
list.Append('('); list.Append('(');
for (var i = 0; i < Parameters.Count; i++) for (var i = 0; i < Parameters.Count; i++)
{ {
var param = Parameters[i] var param =
.Replace("System", String.Empty) Parameters[i].Replace("System", String.Empty)
.Replace("Object", String.Empty) .Replace("Object", String.Empty)
.Replace(" ", String.Empty) .Replace(" ", String.Empty)
.Replace(".", String.Empty) .Replace(".", String.Empty)
.Replace("LuaInterface", String.Empty); .Replace("LuaInterface", String.Empty)
.Replace("Boolean", "bool ")
.Replace("String", "string ")
.Replace("LuaTable", "table ")
.Replace("LuaFunction", "func ");
list.Append(param); list.Append(param);
if (i < Parameters.Count - 1) if (i < Parameters.Count - 1)
{ {
list.Append(','); list.Append(", ");
} }
} }