Lua: Added forms_openfile(filename, path, filter) to LuaImplementation.cs, usage ex: forms.openfile(nil,"C:") or forms.openfile(nil,nil,"Movie Files(*.SMV;*.BKM;*.FMV) etc...
This commit is contained in:
parent
656e7a3862
commit
d3efbb6d3b
|
@ -544,7 +544,8 @@ namespace BizHawk.MultiClient
|
||||||
"clearclicks",
|
"clearclicks",
|
||||||
"gettext",
|
"gettext",
|
||||||
"setproperty",
|
"setproperty",
|
||||||
"getproperty"
|
"getproperty",
|
||||||
|
"openfile"
|
||||||
};
|
};
|
||||||
|
|
||||||
public static string[] BitwiseFunctions = new[]
|
public static string[] BitwiseFunctions = new[]
|
||||||
|
@ -2748,6 +2749,29 @@ namespace BizHawk.MultiClient
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// filterext format ex: "Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*"
|
||||||
|
public string forms_openfile(string FileName = null, string InitialDirectory = null, string Filter = "All files (*.*)|*.*")
|
||||||
|
{
|
||||||
|
OpenFileDialog openFileDialog1 = new OpenFileDialog();
|
||||||
|
if (InitialDirectory != null)
|
||||||
|
{
|
||||||
|
openFileDialog1.InitialDirectory = InitialDirectory;
|
||||||
|
}
|
||||||
|
if (FileName != null)
|
||||||
|
{
|
||||||
|
openFileDialog1.FileName = FileName;
|
||||||
|
}
|
||||||
|
if (Filter != null)
|
||||||
|
{
|
||||||
|
openFileDialog1.AddExtension = true;
|
||||||
|
openFileDialog1.Filter = Filter;
|
||||||
|
}
|
||||||
|
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||||
|
return openFileDialog1.FileName;
|
||||||
|
else
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
public LuaTable input_getmouse()
|
public LuaTable input_getmouse()
|
||||||
{
|
{
|
||||||
LuaTable buttons = _lua.NewTable();
|
LuaTable buttons = _lua.NewTable();
|
||||||
|
|
Loading…
Reference in New Issue