-Hacky removal of a useless save when loading a TasProj

-Made ControlsOrdered much faster
This commit is contained in:
SuuperW 2015-03-23 21:16:13 +00:00
parent 9d7a522576
commit 52659ac9a9
4 changed files with 20 additions and 27 deletions

View File

@ -465,6 +465,7 @@ namespace BizHawk.Client.Common
}
}
// TODO: Delete this, this save is utterly useless.
//If a movie is already loaded, save it before starting a new movie
if (Movie.IsActive && !string.IsNullOrEmpty(Movie.Filename))
{

View File

@ -21,7 +21,9 @@ namespace BizHawk.Client.EmuHawk
public bool StartNewMovie(IMovie movie, bool record)
{
if (movie.IsActive)
// SuuperW: Check changes. adelikat: this could break bk2 movies
// TODO: Clean up the saving process
if (movie.IsActive && (movie.Changes || !(movie is TasMovie)))
{
movie.Save();
}

View File

@ -686,6 +686,9 @@ namespace BizHawk.Client.EmuHawk
private void TAStudio_DragDrop(object sender, DragEventArgs e)
{
if (!AskSaveChanges())
return;
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
if (Path.GetExtension(filePaths[0]) == "." + TasMovie.Extension)
{

View File

@ -112,35 +112,22 @@ namespace BizHawk.Emulation.Common
{
get
{
var list = FloatControls.Union(BoolButtons);
List<string> list = new List<string>(FloatControls);
list.AddRange(BoolButtons);
yield return list
.Where(x => !x.StartsWith("P1 ") && !x.StartsWith("P2 ") && !x.StartsWith("P3 ") && !x.StartsWith("P4 ")
&& !x.StartsWith("P5 ") && !x.StartsWith("P6 ") && !x.StartsWith("P7 ") && !x.StartsWith("P8 "));
List<string>[] ret = new List<string>[9];
for (int i = 0; i < ret.Length; i++)
ret[i] = new List<string>();
yield return list
.Where(x => x.StartsWith("P1 "));
for (int i = 0; i < list.Count; i++)
{
int player = 0;
if (list[i].StartsWith("P") && char.IsNumber(list[i][1]))
player = int.Parse(list[i][1].ToString());
ret[player].Add(list[i]);
}
yield return list
.Where(x => x.StartsWith("P2 "));
yield return list
.Where(x => x.StartsWith("P3 "));
yield return list
.Where(x => x.StartsWith("P4 "));
yield return list
.Where(x => x.StartsWith("P5 "));
yield return list
.Where(x => x.StartsWith("P6 "));
yield return list
.Where(x => x.StartsWith("P7 "));
yield return list
.Where(x => x.StartsWith("P8 "));
return ret;
}
}