send FromCuePath a default CueBinPref object to make it compile. Todo: feed it a correct value??
This commit is contained in:
parent
16ec704e41
commit
7ac7f335f9
|
@ -68,7 +68,7 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
Global.MovieSession = new MovieSession();
|
||||
Global.MovieSession.Movie = new Movie();
|
||||
MainWait = new AutoResetEvent(false)
|
||||
MainWait = new AutoResetEvent(false);
|
||||
Icon = BizHawk.MultiClient.Properties.Resources.logo;
|
||||
InitializeComponent();
|
||||
Global.Game = GameInfo.GetNullGame();
|
||||
|
@ -991,7 +991,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
else if (file.Extension.ToLower() == ".cue")
|
||||
{
|
||||
Disc disc = Disc.FromCuePath(path);
|
||||
Disc disc = Disc.FromCuePath(path, new CueBinPrefs());
|
||||
var hash = disc.GetHash();
|
||||
game = Database.CheckDatabase(hash);
|
||||
if (game == null)
|
||||
|
|
|
@ -229,6 +229,7 @@
|
|||
| System.Windows.Forms.Keys.O)));
|
||||
this.openSessionToolStripMenuItem.Size = new System.Drawing.Size(243, 22);
|
||||
this.openSessionToolStripMenuItem.Text = "&Open Session...";
|
||||
this.openSessionToolStripMenuItem.Click += new System.EventHandler(this.openSessionToolStripMenuItem_Click);
|
||||
//
|
||||
// saveToolStripMenuItem
|
||||
//
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace BizHawk.MultiClient
|
|||
public partial class LuaConsole : Form
|
||||
{
|
||||
//session file saving
|
||||
//session file loading
|
||||
//track changes
|
||||
//new session
|
||||
//open session
|
||||
//recent session
|
||||
|
@ -134,13 +134,13 @@ namespace BizHawk.MultiClient
|
|||
this.Size = new System.Drawing.Size(defaultWidth, defaultHeight);
|
||||
}
|
||||
|
||||
private FileInfo GetFileFromUser()
|
||||
private FileInfo GetFileFromUser(string filter)
|
||||
{
|
||||
var ofd = new OpenFileDialog();
|
||||
if (lastLuaFile.Length > 0)
|
||||
ofd.FileName = Path.GetFileNameWithoutExtension(lastLuaFile);
|
||||
ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.LuaPath, "");
|
||||
ofd.Filter = "Lua Scripts (*.lua)|*.lua|All Files|*.*";
|
||||
ofd.Filter = filter;
|
||||
ofd.RestoreDirectory = true;
|
||||
|
||||
|
||||
|
@ -168,7 +168,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private void OpenLuaFile()
|
||||
{
|
||||
var file = GetFileFromUser();
|
||||
var file = GetFileFromUser("Lua Scripts (*.lua)|*.lua|All Files|*.*");
|
||||
if (file != null)
|
||||
{
|
||||
LoadLuaFile(file.FullName);
|
||||
|
@ -210,10 +210,10 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
LuaListView.Refresh();
|
||||
UpdateNumberOfScripts();
|
||||
RunLuaScript();
|
||||
RunLuaScripts();
|
||||
}
|
||||
|
||||
private void RunLuaScript()
|
||||
private void RunLuaScripts()
|
||||
{
|
||||
for (int x = 0; x < luaList.Count; x++)
|
||||
{
|
||||
|
@ -277,6 +277,16 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private void newToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
NewLuaSession(false);
|
||||
}
|
||||
|
||||
private void NewLuaSession(bool suppressAsk)
|
||||
{
|
||||
//TODO: ask save
|
||||
StopAllScripts();
|
||||
luaList.Clear();
|
||||
DisplayLuaList();
|
||||
UpdateNumberOfScripts();
|
||||
|
||||
}
|
||||
|
||||
|
@ -573,23 +583,61 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
var file = new FileInfo(path);
|
||||
if (file.Exists == false) return false;
|
||||
|
||||
StopAllScripts();
|
||||
luaList = new List<LuaFiles>();
|
||||
|
||||
using (StreamReader sr = file.OpenText())
|
||||
{
|
||||
int count = 0;
|
||||
bool enabled = false;
|
||||
string s = "";
|
||||
string temp = "";
|
||||
|
||||
while ((s = sr.ReadLine()) != null)
|
||||
{
|
||||
//.luases
|
||||
if (s.Length < 1) continue;
|
||||
if (s.Length < 3) continue;
|
||||
|
||||
temp = s.Substring(0, 1); //Get enabled flag
|
||||
|
||||
try
|
||||
{
|
||||
if (int.Parse(temp) == 0)
|
||||
enabled = false;
|
||||
else
|
||||
enabled = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false; //TODO: report an error?
|
||||
}
|
||||
|
||||
s = s.Substring(2, s.Length - 2); //Get path
|
||||
|
||||
LuaFiles l = new LuaFiles(s);
|
||||
l.Enabled = enabled;
|
||||
luaList.Add(l);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OpenLuaSession()
|
||||
{
|
||||
var file = GetFileFromUser("Lua Session Files (*.luases)|*.luases|All Files|*.*");
|
||||
if (file != null)
|
||||
{
|
||||
LoadLuaSession(file.FullName);
|
||||
RunLuaScripts();
|
||||
DisplayLuaList();
|
||||
UpdateNumberOfScripts();
|
||||
}
|
||||
}
|
||||
|
||||
private void openSessionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenLuaSession();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace BizHawk
|
|||
//var cueBin = disc.DumpCueBin("Bomberman '94 Taikenban (SCD)(JPN)_hawked", prefs);
|
||||
//cueBin.Dump(@"D:\discs\Bomberman_'94_Taikenban_(SCD)(JPN)_-_wav'd", prefs);
|
||||
|
||||
DiscSystem.Disc disc = DiscSystem.Disc.FromCuePath(@"D:\discs\R-Type Complete CD (J)");
|
||||
DiscSystem.Disc disc = DiscSystem.Disc.FromCuePath(@"D:\discs\R-Type Complete CD (J)", new DiscSystem.CueBinPrefs());
|
||||
var prefs = new DiscSystem.CueBinPrefs();
|
||||
prefs.AnnotateCue = false;
|
||||
prefs.OneBlobPerTrack = false;
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace BizHawk
|
|||
if (ofd.ShowDialog() != DialogResult.OK)
|
||||
return;
|
||||
|
||||
Disc disc = Disc.FromCuePath(ofd.FileName);
|
||||
Disc disc = Disc.FromCuePath(ofd.FileName, new CueBinPrefs());
|
||||
|
||||
string baseName = Path.GetFileName(ofd.FileName);
|
||||
ListViewItem lvi = new ListViewItem(baseName);
|
||||
|
@ -152,7 +152,7 @@ namespace BizHawk
|
|||
{
|
||||
foreach (var file in files)
|
||||
{
|
||||
Disc disc = Disc.FromCuePath(file);
|
||||
Disc disc = Disc.FromCuePath(file, new CueBinPrefs());
|
||||
string baseName = Path.GetFileNameWithoutExtension(file);
|
||||
baseName += "_hawked";
|
||||
var prefs = GetCuePrefs();
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace BizHawk
|
|||
{
|
||||
foreach (var file in files)
|
||||
{
|
||||
Disc disc = Disc.FromCuePath(file);
|
||||
Disc disc = Disc.FromCuePath(file, new CueBinPrefs());
|
||||
string baseName = Path.GetFileNameWithoutExtension(file);
|
||||
baseName += "_hawked";
|
||||
var prefs = GetCuePrefs();
|
||||
|
@ -131,7 +131,7 @@ namespace BizHawk
|
|||
if (files.Count == 0) return;
|
||||
foreach (var file in files)
|
||||
{
|
||||
using (var disc = Disc.FromCuePath(file))
|
||||
using (var disc = Disc.FromCuePath(file, new CueBinPrefs()))
|
||||
{
|
||||
var path = Path.GetDirectoryName(file);
|
||||
var filename = Path.GetFileNameWithoutExtension(file);
|
||||
|
|
Loading…
Reference in New Issue