Lua ditto for joypad library and slight fix documentation

This commit is contained in:
adelikat 2014-01-26 00:01:40 +00:00
parent 71b52970f6
commit c6859a6d4f
3 changed files with 22 additions and 7 deletions

View File

@ -27,7 +27,11 @@ namespace BizHawk.Client.Common
private readonly Lua _lua;
public LuaTable joypad_get(object controller = null)
[LuaMethodAttributes(
"get",
"TODO"
)]
public LuaTable Get(object controller = null)
{
var buttons = _lua.NewTable();
foreach (var button in Global.ControllerOutput.Source.Type.BoolButtons)
@ -61,7 +65,11 @@ namespace BizHawk.Client.Common
return buttons;
}
public LuaTable joypad_getimmediate()
[LuaMethodAttributes(
"getimmediate",
"TODO"
)]
public LuaTable GetImmediate()
{
var buttons = _lua.NewTable();
foreach (var button in Global.ActiveController.Type.BoolButtons)
@ -72,7 +80,11 @@ namespace BizHawk.Client.Common
return buttons;
}
public void joypad_set(LuaTable buttons, object controller = null)
[LuaMethodAttributes(
"set",
"TODO"
)]
public void Set(LuaTable buttons, object controller = null)
{
try
{
@ -103,7 +115,6 @@ namespace BizHawk.Client.Common
theValue = null;
}
if (!invert)
{
if (theValue == true)
@ -164,7 +175,11 @@ namespace BizHawk.Client.Common
}
}
public void joypad_setanalog(LuaTable controls, object controller = null)
[LuaMethodAttributes(
"setanalog",
"TODO"
)]
public void SetAnalog(LuaTable controls, object controller = null)
{
try
{

View File

@ -45,7 +45,7 @@ namespace BizHawk.Client.Common
if (docs != null)
{
docs.Add(Name, luaName, method, luaMethodAttr.Description);
docs.Add(Name, luaMethodAttr.Name, method, luaMethodAttr.Description);
}
}
}

View File

@ -94,7 +94,7 @@ namespace BizHawk.Client.EmuHawk
_formsLibrary.LuaRegister(lua, Docs);
_guiLibrary.LuaRegister(lua, Docs);
new InputLuaLibrary(_lua).LuaRegister(lua, Docs);
new JoypadLuaLibrary(_lua).LuaRegister(lua, Docs);
new JoypadLuaLibrary(_lua).LuaRegisterNew(lua, Docs);
new MemoryLuaLibrary().LuaRegister(lua, Docs);
new MainMemoryLuaLibrary(_lua).LuaRegister(lua, Docs);
new MovieLuaLibrary(_lua).LuaRegister(lua, Docs);