Joypad.Get recieves a numeric parameter to return only the specified controller. Is there other way to know of what controller is a button other than the first 2 characters of the string?
This commit is contained in:
parent
40e2d5f543
commit
f7f4e64985
|
@ -1177,12 +1177,11 @@ namespace BizHawk.MultiClient
|
|||
LuaTable input = lua.NewTable();
|
||||
|
||||
string s = Global.MovieSession.Movie.GetInputFrame(LuaInt(frame));
|
||||
|
||||
MovieControllerAdapter m = new MovieControllerAdapter();
|
||||
m.Type = Global.MovieSession.MovieControllerAdapter.Type;
|
||||
m.SetControllersAsMnemonic(s);
|
||||
foreach (string button in m.Type.BoolButtons)
|
||||
input[button] = m[button];
|
||||
foreach (string button in m.Type.BoolButtons)
|
||||
input[button] = m[button];
|
||||
|
||||
return input;
|
||||
}
|
||||
|
@ -1204,11 +1203,15 @@ namespace BizHawk.MultiClient
|
|||
//----------------------------------------------------
|
||||
|
||||
//Currently sends all controllers, needs to control which ones it sends
|
||||
public LuaTable joypad_get()
|
||||
public LuaTable joypad_get(object controller)
|
||||
{
|
||||
LuaTable buttons = lua.NewTable();
|
||||
foreach (string button in Global.ControllerOutput.Source.Type.BoolButtons)
|
||||
buttons[button] = Global.ControllerOutput[button];
|
||||
foreach (string button in Global.ControllerOutput.Source.Type.BoolButtons)
|
||||
if (button.Substring(0, 2) == "P" + LuaInt(controller).ToString())
|
||||
buttons[button] = Global.ControllerOutput[button];
|
||||
|
||||
foreach (var asd in Global.ControllerOutput.Source.Type.FloatControls)
|
||||
MessageBox.Show(asd);
|
||||
|
||||
//zero 23-mar-2012 - wtf is this??????
|
||||
buttons["clear"] = null;
|
||||
|
|
|
@ -844,6 +844,45 @@ namespace BizHawk.MultiClient
|
|||
return str;
|
||||
}
|
||||
|
||||
public string GetMovieExtName()
|
||||
{
|
||||
string str = "", system = Global.Game.System, ext = GetAlternateExt();
|
||||
switch (system)
|
||||
{
|
||||
case "SG": str += "SG-1000"; break;
|
||||
case "SMS": str += "Sega Master System"; break;
|
||||
case "GG": str += "Game Gear"; break;
|
||||
case "PCECD": str += "TurboGrafx-16 (CD)"; break;
|
||||
case "PCE": str += "TurboGrafx-16"; break;
|
||||
case "SGX": str += "SuperGrafx"; break;
|
||||
case "GEN": str += "Genesis"; break;
|
||||
case "TI83": str += "TI-83"; break;
|
||||
case "NES": str += "NES"; break;
|
||||
case "GB": str += "Game Boy"; break;
|
||||
}
|
||||
return str + " Movie File (*" + ext + ")|*" + ext;
|
||||
}
|
||||
|
||||
private string GetAlternateExt()
|
||||
{
|
||||
string str = ".", system = Global.Game.System;
|
||||
switch (system)
|
||||
{
|
||||
case "SG": str += "1000"; break;
|
||||
case "SMS": str += "sms"; break;
|
||||
case "GG": str += "gg"; break;
|
||||
case "PCECD": str += "pcecd"; break;
|
||||
case "PCE": str += "pce"; break;
|
||||
case "SGX": str += "sgx"; break;
|
||||
case "GEN": str += "gen"; break;
|
||||
case "TI83": str += "ti83"; break;
|
||||
case "NES": str += "nes"; break;
|
||||
case "GB": str += "gb"; break;
|
||||
}
|
||||
|
||||
return str + ".tas";
|
||||
}
|
||||
|
||||
private void HandlePlatformMenus()
|
||||
{
|
||||
string system = "";
|
||||
|
|
|
@ -72,7 +72,8 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, "");
|
||||
ofd.Filter = "Movie files (*.tas)|*.TAS;*.ZIP;*.7z|Savestates|*.state|Archive Files|*.zip;*.7z|All Files|*.*";
|
||||
//ofd.Filter = "Generic Movie Files (*.tas)|*.tas;*.zip;*.7z|" + Global.MainForm.GetMovieExtName() + "|Savestates|*.state|Archive Files|*.zip;*.7z|All Files|*.*";
|
||||
ofd.Filter = "Generic Movie Files (*.tas)|*.tas;*.zip;*.7z|Savestates|*.state|Archive Files|*.zip;*.7z|All Files|*.*";
|
||||
|
||||
Global.Sound.StopSound();
|
||||
var result = ofd.ShowDialog();
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace BizHawk.MultiClient
|
|||
var writer = new StreamWriter(temppath);
|
||||
Global.Emulator.SaveStateText(writer);
|
||||
writer.Close();
|
||||
|
||||
|
||||
var file = new FileInfo(temppath);
|
||||
using (StreamReader sr = file.OpenText())
|
||||
{
|
||||
|
@ -110,8 +110,9 @@ namespace BizHawk.MultiClient
|
|||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, "");
|
||||
sfd.DefaultExt = ".tas";
|
||||
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
|
||||
sfd.Filter = "Movie files (*.tas)|*.tas";
|
||||
sfd.FileName = PathManager.FilesystemSafeName(Global.Game) + "." + sfd.DefaultExt;
|
||||
//sfd.Filter = "Generic Movie Files (*.tas)|*.tas|" + Global.MainForm.GetMovieExtName() + "|All Files (*.*)|*.*";
|
||||
sfd.Filter = "Generic Movie Files (*.tas)|*.tas|All Files (*.*)|*.*";
|
||||
|
||||
Global.Sound.StopSound();
|
||||
var result = sfd.ShowDialog();
|
||||
|
|
Loading…
Reference in New Issue