Now looks good :)

This commit is contained in:
Azreal 2018-03-10 03:00:44 -08:00
parent 26c0b1fff2
commit 6032063518
9 changed files with 55 additions and 55 deletions

View File

@ -150,7 +150,7 @@ namespace BizHawk.Client.Common
}
catch
{
/*Eat it*/
/*Eat it*/
}
}

View File

@ -164,7 +164,7 @@ namespace BizHawk.Client.Common
WriteUnsignedByte(addr, value, domain);
}
[LuaMethodExample("readbyterange" , "local nlmemrea = memory.readbyterange( 0x100, 30, mainmemory.getname( ) );")]
[LuaMethodExample("readbyterange", "local nlmemrea = memory.readbyterange( 0x100, 30, mainmemory.getname( ) );")]
[LuaMethod("readbyterange", "Reads the address range that starts from address, and is length long. Returns the result into a table of key value pairs (where the address is the key).")]
public new LuaTable ReadByteRange(int addr, int length, string domain = null)
{
@ -309,7 +309,7 @@ namespace BizHawk.Client.Common
return ReadSignedBig(addr, 3, domain);
}
[LuaMethodExample("write_s24_be" , "memory.write_s24_be( 0x100, -1000, mainmemory.getname( ) );")]
[LuaMethodExample("write_s24_be", "memory.write_s24_be( 0x100, -1000, mainmemory.getname( ) );")]
[LuaMethod("write_s24_be", "write signed 24 bit value, big endian")]
public void WriteS24Big(int addr, int value, string domain = null)
{

View File

@ -124,17 +124,17 @@ namespace BizHawk.Client.Common
{
return "FINISHED";
}
if (Global.MovieSession.Movie.IsPlaying)
{
return "PLAY";
}
if (Global.MovieSession.Movie.IsRecording)
{
return "RECORD";
}
return "INACTIVE";
}

View File

@ -63,7 +63,7 @@ namespace BizHawk.Client.Common
return GetSettings().ShowBG4_1;
}
[LuaMethodExample("getlayer_obj_1" , "if ( snes.getlayer_obj_1( ) ) then\r\n\tconsole.log( \"Returns whether the obj 1 layer is displayed\" );\r\nend;")]
[LuaMethodExample("getlayer_obj_1", "if ( snes.getlayer_obj_1( ) ) then\r\n\tconsole.log( \"Returns whether the obj 1 layer is displayed\" );\r\nend;")]
[LuaMethod("getlayer_obj_1", "Returns whether the obj 1 layer is displayed")]
public bool GetLayerObj1()
{
@ -127,7 +127,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_obj_1" , "snes.setlayer_obj_1( true );")]
[LuaMethodExample("setlayer_obj_1", "snes.setlayer_obj_1( true );")]
[LuaMethod("setlayer_obj_1", "Sets whether the obj 1 layer is displayed")]
public void SetLayerObj1(bool value)
{

View File

@ -22,7 +22,7 @@ namespace BizHawk.Client.Common
string connectionString;
[LuaMethodExample("createdatabase", "local stSQLcre = SQL.createdatabase( \"eg_db\" );")]
[LuaMethod("createdatabase","Creates a SQLite Database. Name should end with .db")]
[LuaMethod("createdatabase", "Creates a SQLite Database. Name should end with .db")]
public string CreateDatabase(string name)
{
try
@ -56,7 +56,7 @@ namespace BizHawk.Client.Common
m_dbConnection.Close();
return "Database Opened Successfully";
}
catch(SQLiteException sqlEX)
catch (SQLiteException sqlEX)
{
return sqlEX.Message;
}
@ -65,7 +65,7 @@ namespace BizHawk.Client.Common
[LuaMethodExample("writecommand", "local stSQLwri = SQL.writecommand( \"CREATE TABLE eg_tab ( eg_tab_id integer PRIMARY KEY, eg_tab_row_name text NOT NULL ); INSERT INTO eg_tab ( eg_tab_id, eg_tab_row_name ) VALUES ( 1, 'Example table row' );\" );")]
[LuaMethod("writecommand", "Runs a SQLite write command which includes CREATE,INSERT, UPDATE. " +
"Ex: create TABLE rewards (ID integer PRIMARY KEY, action VARCHAR(20)) ")]
public string WriteCommand(string query="")
public string WriteCommand(string query = "")
{
if (query == "")
{
@ -86,7 +86,7 @@ namespace BizHawk.Client.Common
{
return "Database not open.";
}
catch(SQLiteException sqlEX)
catch (SQLiteException sqlEX)
{
m_dbConnection.Close();
return sqlEX.Message;
@ -96,9 +96,9 @@ namespace BizHawk.Client.Common
[LuaMethodExample("readcommand", "local obSQLrea = SQL.readcommand( \"SELECT * FROM eg_tab WHERE eg_tab_id = 1;\" );")]
[LuaMethod("readcommand", "Run a SQLite read command which includes Select. Returns all rows into a LuaTable." +
"Ex: select * from rewards")]
public dynamic ReadCommand(string query="")
public dynamic ReadCommand(string query = "")
{
if (query=="")
if (query == "")
{
return "query is empty";
}
@ -106,10 +106,10 @@ namespace BizHawk.Client.Common
{
var table = Lua.NewTable();
m_dbConnection.Open();
string sql = "PRAGMA read_uncommitted =1;"+query;
string sql = "PRAGMA read_uncommitted =1;" + query;
SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
SQLiteDataReader reader = command.ExecuteReader();
bool rows=reader.HasRows;
bool rows = reader.HasRows;
long rowCount = 0;
var columns = new List<string>();
for (int i = 0; i < reader.FieldCount; ++i) //Add all column names into list
@ -117,16 +117,16 @@ namespace BizHawk.Client.Common
columns.Add(reader.GetName(i));
}
while (reader.Read())
{
{
for (int i = 0; i < reader.FieldCount; ++i)
{
table[columns[i]+" "+rowCount.ToString()] = reader.GetValue(i);
table[columns[i] + " " + rowCount.ToString()] = reader.GetValue(i);
}
rowCount += 1;
}
reader.Close();
m_dbConnection.Close();
if (rows==false)
if (rows == false)
{
return "No rows found";
}

View File

@ -52,7 +52,7 @@ namespace BizHawk.Client.Common
return octal;
}
[LuaMethodExample("trim" , "local stbiztri = bizstring.trim( \"Some trim string\t \" );")]
[LuaMethodExample("trim", "local stbiztri = bizstring.trim( \"Some trim string\t \" );")]
[LuaMethod("trim", "returns a string that trims whitespace on the left and right ends of the string")]
public static string Trim(string str)
{

View File

@ -346,7 +346,7 @@ namespace BizHawk.Client.EmuHawk
{
GlobalWin.MainForm.TogglePause();
}
[LuaMethodExample("transformPointX", "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)
@ -409,7 +409,7 @@ namespace BizHawk.Client.EmuHawk
[LuaMethod("gettool", "Returns an object that represents a tool of the given name (not case sensitive). If the tool is not open, it will be loaded if available. Use gettools to get a list of names")]
public LuaTable GetTool(string name)
{
var toolType = ReflectionUtil.GetTypeByName(name)
var toolType = ReflectionUtil.GetTypeByName(name)
.FirstOrDefault(x => typeof(IToolForm).IsAssignableFrom(x) && !x.IsInterface);
if (toolType != null)

View File

@ -200,7 +200,7 @@ namespace BizHawk.Client.EmuHawk
try
{
var pointsArr = new Point[4];
var i = 0;
foreach (LuaTable point in points.Values)
{

View File

@ -48,7 +48,7 @@ namespace BizHawk.Client.EmuHawk
};
private List<PendingChanges> changeList = new List<PendingChanges>(); //TODO: Initialize it to empty list on a script reload, and have each script have it's own list
[LuaMethodExample("engaged", "if ( tastudio.engaged( ) ) then\r\n\tconsole.log( \"returns whether or not tastudio is currently engaged ( active )\" );\r\nend;")]
[LuaMethod("engaged", "returns whether or not tastudio is currently engaged (active)")]
public bool Engaged()
@ -63,7 +63,7 @@ namespace BizHawk.Client.EmuHawk
return Tastudio.TasPlaybackBox.RecordingMode;
}
[LuaMethodExample("setrecording" , "tastudio.setrecording( true );")]
[LuaMethodExample("setrecording", "tastudio.setrecording( true );")]
[LuaMethod("setrecording", "sets the recording mode on/off depending on the parameter")]
public void SetRecording(bool val)
{
@ -73,14 +73,14 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("togglerecording" , "tastudio.togglerecording( );")]
[LuaMethodExample("togglerecording", "tastudio.togglerecording( );")]
[LuaMethod("togglerecording", "toggles tastudio recording mode on/off depending on its current state")]
public void SetRecording()
{
Tastudio.ToggleReadOnly();
}
[LuaMethodExample("setbranchtext" , "tastudio.setbranchtext( \"Some text\", 1 );")]
[LuaMethodExample("setbranchtext", "tastudio.setbranchtext( \"Some text\", 1 );")]
[LuaMethod("setbranchtext", "adds the given message to the existing branch, or to the branch that will be created next if branch index is not specified")]
public void SetBranchText(string text, int? index = null)
{
@ -94,7 +94,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("getmarker" , "local sttasget = tastudio.getmarker( 500 );")]
[LuaMethodExample("getmarker", "local sttasget = tastudio.getmarker( 500 );")]
[LuaMethod("getmarker", "returns the marker text at the given frame, or an empty string if there is no marker for the given frame")]
public string GetMarker(int frame)
{
@ -106,11 +106,11 @@ namespace BizHawk.Client.EmuHawk
return marker.Message;
}
}
return "";
}
[LuaMethodExample("removemarker" , "tastudio.removemarker( 500 );")]
[LuaMethodExample("removemarker", "tastudio.removemarker( 500 );")]
[LuaMethod("removemarker", "if there is a marker for the given frame, it will be removed")]
public void RemoveMarker(int frame)
{
@ -125,7 +125,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("setmarker" , "tastudio.setmarker( 500, \"Some message\" );")]
[LuaMethodExample("setmarker", "tastudio.setmarker( 500, \"Some message\" );")]
[LuaMethod("setmarker", "Adds or sets a marker at the given frame, with an optional message")]
public void SetMarker(int frame, string message = null)
{
@ -144,7 +144,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("islag" , "local botasisl = tastudio.islag( 500 );")]
[LuaMethodExample("islag", "local botasisl = tastudio.islag( 500 );")]
[LuaMethod("islag", "Returns whether or not the given frame was a lag frame, null if unknown")]
public bool? IsLag(int frame)
{
@ -159,7 +159,7 @@ namespace BizHawk.Client.EmuHawk
return null;
}
[LuaMethodExample("setlag" , "tastudio.setlag( 500, true );")]
[LuaMethodExample("setlag", "tastudio.setlag( 500, true );")]
[LuaMethod("setlag", "Sets the lag information for the given frame, if the frame does not exist in the lag log, it will be added. If the value is null, the lag information for that frame will be removed")]
public void SetLag(int frame, bool? value)
{
@ -169,7 +169,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("hasstate" , "if ( tastudio.hasstate( 500 ) ) then\r\n\tconsole.log( \"Returns whether or not the given frame has a savestate associated with it\" );\r\nend;")]
[LuaMethodExample("hasstate", "if ( tastudio.hasstate( 500 ) ) then\r\n\tconsole.log( \"Returns whether or not the given frame has a savestate associated with it\" );\r\nend;")]
[LuaMethod("hasstate", "Returns whether or not the given frame has a savestate associated with it")]
public bool HasState(int frame)
{
@ -184,7 +184,7 @@ namespace BizHawk.Client.EmuHawk
return false;
}
[LuaMethodExample("setplayback" , "tastudio.setplayback( 1500 );")]
[LuaMethodExample("setplayback", "tastudio.setplayback( 1500 );")]
[LuaMethod("setplayback", "Seeks the given frame (a number) or marker (a string)")]
public void SetPlayback(object frame)
{
@ -213,7 +213,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("onqueryitembg" , "tastudio.onqueryitembg( function( currentindex, itemname )\r\n\tconsole.log( \"called during the background draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethodExample("onqueryitembg", "tastudio.onqueryitembg( function( currentindex, itemname )\r\n\tconsole.log( \"called during the background draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethod("onqueryitembg", "called during the background draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)")]
public void OnQueryItemBg(LuaFunction luaf)
{
@ -234,7 +234,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("onqueryitemtext" , "tastudio.onqueryitemtext( function( currentindex, itemname )\r\n\tconsole.log( \"called during the text draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethodExample("onqueryitemtext", "tastudio.onqueryitemtext( function( currentindex, itemname )\r\n\tconsole.log( \"called during the text draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethod("onqueryitemtext", "called during the text draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)")]
public void OnQueryItemText(LuaFunction luaf)
{
@ -249,7 +249,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("onqueryitemicon" , "tastudio.onqueryitemicon( function( currentindex, itemname )\r\n\tconsole.log( \"called during the icon draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethodExample("onqueryitemicon", "tastudio.onqueryitemicon( function( currentindex, itemname )\r\n\tconsole.log( \"called during the icon draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)\" );\r\nend );")]
[LuaMethod("onqueryitemicon", "called during the icon draw event of the tastudio listview. luaf must be a function that takes 2 params: index, column. The first is the integer row index of the listview, and the 2nd is the string column name. luaf should return a value that can be parsed into a .NET Color object (string color name, or integer value)")]
public void OnQueryItemIcon(LuaFunction luaf)
{
@ -270,7 +270,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("ongreenzoneinvalidated" , "tastudio.ongreenzoneinvalidated( function( currentindex, itemname )\r\n\tconsole.log( \"called whenever the greenzone is invalidated and returns the first frame that was invalidated\" );\r\nend );")]
[LuaMethodExample("ongreenzoneinvalidated", "tastudio.ongreenzoneinvalidated( function( currentindex, itemname )\r\n\tconsole.log( \"called whenever the greenzone is invalidated and returns the first frame that was invalidated\" );\r\nend );")]
[LuaMethod("ongreenzoneinvalidated", "called whenever the greenzone is invalidated and returns the first frame that was invalidated")]
public void OnGreenzoneInvalidated(LuaFunction luaf)
{
@ -283,8 +283,8 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("onbranchload" , "tastudio.ongreenzoneinvalidated( function( currentindex, itemname )\r\n\tconsole.log( \"called whenever the greenzone is invalidated and returns the first frame that was invalidated\" );\r\nend );")]
[LuaMethod("onbranchload","called whenever a branch is loaded. luaf must be a function that takes the integer branch index as a parameter")]
[LuaMethodExample("onbranchload", "tastudio.ongreenzoneinvalidated( function( currentindex, itemname )\r\n\tconsole.log( \"called whenever the greenzone is invalidated and returns the first frame that was invalidated\" );\r\nend );")]
[LuaMethod("onbranchload", "called whenever a branch is loaded. luaf must be a function that takes the integer branch index as a parameter")]
public void OnBranchLoad(LuaFunction luaf)
{
if (Engaged())
@ -296,7 +296,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample( "onbranchsave", "")]
[LuaMethodExample("onbranchsave", "")]
[LuaMethod("onbranchsave", "called whenever a branch is created or updated. luaf must be a function that takes the integer branch index as a parameter")]
public void OnBranchSave(LuaFunction luaf)
{
@ -309,7 +309,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("onbranchremove" , "")]
[LuaMethodExample("onbranchremove", "")]
[LuaMethod("onbranchremove", "called whenever a branch is removed. luaf must be a function that takes the integer branch index as a parameter")]
public void OnBranchRemove(LuaFunction luaf)
{
@ -322,7 +322,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("getselection" , "local nltasget = tastudio.getselection( );")]
[LuaMethodExample("getselection", "local nltasget = tastudio.getselection( );")]
[LuaMethod("getselection", "gets the currently selected frames")]
public LuaTable GetSelection()
{
@ -348,7 +348,7 @@ namespace BizHawk.Client.EmuHawk
public string Text { get; set; }
}
[LuaMethodExample("getbranches" , "local nltasget = tastudio.getbranches( );")]
[LuaMethodExample("getbranches", "local nltasget = tastudio.getbranches( );")]
[LuaMethod("getbranches", "Returns a list of the current tastudio branches. Each entry will have the Id, Frame, and Text properties of the branch")]
public LuaTable GetBranches()
{
@ -374,7 +374,7 @@ namespace BizHawk.Client.EmuHawk
}
[LuaMethodExample("getbranchinput" , "local nltasget = tastudio.getbranchinput( \"97021544-2454-4483-824f-47f75e7fcb6a\", 500 );")]
[LuaMethodExample("getbranchinput", "local nltasget = tastudio.getbranchinput( \"97021544-2454-4483-824f-47f75e7fcb6a\", 500 );")]
[LuaMethod("getbranchinput", "Gets the controller state of the given frame with the given branch identifier")]
public LuaTable GetBranchInput(string branchId, int frame)
{
@ -388,7 +388,7 @@ namespace BizHawk.Client.EmuHawk
if (frame < branch.InputLog.Count)
{
var input = branch.InputLog[frame];
var adapter = new Bk2ControllerAdapter
{
Definition = Global.MovieSession.MovieControllerAdapter.Definition
@ -412,8 +412,8 @@ namespace BizHawk.Client.EmuHawk
return table;
}
[LuaMethodExample("submitinputchange" , "")]
[LuaMethod("submitinputchange","")]
[LuaMethodExample("submitinputchange", "")]
[LuaMethod("submitinputchange", "")]
public void SubmitInputChange(int frame, string button, bool value)
{
if (Engaged())
@ -453,8 +453,8 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("submitanalogchange" , "")]
[LuaMethod("submitanalogchange","")]
[LuaMethodExample("submitanalogchange", "")]
[LuaMethod("submitanalogchange", "")]
public void SubmitAnalogChange(int frame, string button, float value)
{
if (Engaged())
@ -494,7 +494,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample( "submitinsertframes", "")]
[LuaMethodExample("submitinsertframes", "")]
[LuaMethod("submitinsertframes", "")]
public void SubmitInsertFrames(int frame, int number)
{
@ -513,7 +513,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample("submitdeleteframes" , "")]
[LuaMethodExample("submitdeleteframes", "")]
[LuaMethod("submitdeleteframes", "")]
public void SubmitDeleteFrames(int frame, int number)
{
@ -532,7 +532,7 @@ namespace BizHawk.Client.EmuHawk
}
}
[LuaMethodExample( "applyinputchanges", "")]
[LuaMethodExample("applyinputchanges", "")]
[LuaMethod("applyinputchanges", "")]
public void ApplyInputChanges()
{
@ -575,7 +575,7 @@ namespace BizHawk.Client.EmuHawk
}
[LuaMethodExample("clearinputchanges", "")]
[LuaMethod("clearinputchanges","")]
[LuaMethod("clearinputchanges", "")]
public void ClearInputChanges()
{
if (Engaged())