Lua - started a client library for functions that control the multiclient. Added client.openramwatch() as a proof of concept.
This commit is contained in:
parent
48c651cfc7
commit
78cc4d5cae
|
@ -2,13 +2,14 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using LuaInterface;
|
||||
using System.Windows.Forms;
|
||||
using BizHawk.MultiClient.tools;
|
||||
|
||||
namespace BizHawk.MultiClient
|
||||
{
|
||||
class LuaImplementation
|
||||
public class LuaImplementation
|
||||
{
|
||||
Lua lua = new Lua();
|
||||
LuaConsole Caller;
|
||||
|
@ -62,6 +63,13 @@ namespace BizHawk.MultiClient
|
|||
lua.RegisterFunction("joypad." + JoypadFunctions[i], this, this.GetType().GetMethod("joypad_" + JoypadFunctions[i]));
|
||||
LuaLibraryList += "joypad." + JoypadFunctions[i] + "\n";
|
||||
}
|
||||
|
||||
lua.NewTable("client");
|
||||
for (int i = 0; i < MultiClientFunctions.Length; i++)
|
||||
{
|
||||
lua.RegisterFunction("client." + MultiClientFunctions[i], this, this.GetType().GetMethod("client_" + MultiClientFunctions[i]));
|
||||
LuaLibraryList += "client." + MultiClientFunctions[i] + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
public void DoLuaFile(string File)
|
||||
|
@ -98,6 +106,9 @@ namespace BizHawk.MultiClient
|
|||
//"register"
|
||||
};
|
||||
public static string[] MemoryFunctions = new string[] {
|
||||
//"usememorydomain",
|
||||
//"getmemorydomainlist",
|
||||
//"getcurrentmemorydomain",
|
||||
"readbyte",
|
||||
//"readbytesigned",
|
||||
//"readword",
|
||||
|
@ -114,7 +125,7 @@ namespace BizHawk.MultiClient
|
|||
public static string[] SaveStateFunctions = new string[] {
|
||||
//"create",
|
||||
"save",
|
||||
//"load",
|
||||
"load"
|
||||
//"write"
|
||||
};
|
||||
public static string[] MovieFunctions = new string[] {
|
||||
|
@ -127,6 +138,10 @@ namespace BizHawk.MultiClient
|
|||
//"get",
|
||||
};
|
||||
|
||||
public static string[] MultiClientFunctions = new string[] {
|
||||
"openramwatch"
|
||||
};
|
||||
|
||||
/****************************************************/
|
||||
/*************function definitions********************/
|
||||
/****************************************************/
|
||||
|
@ -228,7 +243,18 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void savestate_save(object lua_input)
|
||||
{
|
||||
//
|
||||
if (lua_input.GetType() == typeof(string))
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
public void savestate_load(object lua_input)
|
||||
{
|
||||
if (lua_input.GetType() == typeof(string))
|
||||
{
|
||||
Global.MainForm.LoadStateFile(lua_input.ToString(), Path.GetFileName(lua_input.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
@ -261,5 +287,14 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//Client library
|
||||
//----------------------------------------------------
|
||||
|
||||
public void client_openramwatch()
|
||||
{
|
||||
Global.MainForm.LoadRamWatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1834,7 +1834,7 @@ namespace BizHawk.MultiClient
|
|||
SaveStateFile(writer, sfd.FileName);
|
||||
}
|
||||
|
||||
private void LoadStateFile(string path, string name)
|
||||
public void LoadStateFile(string path, string name)
|
||||
{
|
||||
if (HandleMovieLoadState(path))
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace BizHawk.MultiClient
|
|||
int defaultHeight;
|
||||
|
||||
List<LuaFiles> luaList = new List<LuaFiles>();
|
||||
LuaImplementation LuaImp;
|
||||
public LuaImplementation LuaImp;
|
||||
string lastLuaFile = "";
|
||||
|
||||
private List<LuaFiles> GetLuaFileList()
|
||||
|
|
Loading…
Reference in New Issue