Don't generate `LogKey:` in GenerateLogKey
this would cause `LogKey:LogKey:...` to get written when setting the value with the result of a GenerateLogKey call. Luckily this was not an issue for us because the reading code indescriminately replaces all occurances of `LogKey` with nothing.
This commit is contained in:
parent
0a95d86094
commit
c94c3a6fb1
|
@ -54,7 +54,6 @@ namespace BizHawk.Client.Common
|
|||
public string GenerateLogKey()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("LogKey:");
|
||||
|
||||
foreach (var group in _source.Definition.ControlsOrdered.Where(static c => c.Count is not 0))
|
||||
{
|
||||
|
|
|
@ -13,15 +13,8 @@ namespace BizHawk.Client.Common
|
|||
public void WriteInputLog(TextWriter writer)
|
||||
{
|
||||
writer.WriteLine("[Input]");
|
||||
if (string.IsNullOrEmpty(LogKey))
|
||||
{
|
||||
var lg = LogGeneratorInstance(Session.MovieController);
|
||||
writer.WriteLine(lg.GenerateLogKey());
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteLine($"LogKey:{LogKey}");
|
||||
}
|
||||
writer.Write("LogKey:");
|
||||
writer.WriteLine(string.IsNullOrEmpty(LogKey) ? LogGeneratorInstance(Session.MovieController).GenerateLogKey() : LogKey);
|
||||
|
||||
foreach (var record in Log)
|
||||
{
|
||||
|
|
|
@ -190,9 +190,10 @@ namespace BizHawk.Client.Common.movie.import
|
|||
Result.Movie.HeaderEntries[HeaderKeys.GameName] = gameName;
|
||||
}
|
||||
|
||||
var _controllers = new Snes9xControllers(ss);
|
||||
Result.Movie.LogKey = new Bk2LogEntryGenerator("SNES", new Bk2Controller(_controllers.ControllerDefinition)).GenerateLogKey();
|
||||
SimpleController controllers = new(_controllers.ControllerDefinition);
|
||||
ControllerDefinition definition = new Snes9xControllers(ss).ControllerDefinition;
|
||||
SimpleController controllers = new(definition);
|
||||
|
||||
Result.Movie.LogKey = new Bk2LogEntryGenerator(VSystemID.Raw.SNES, new Bk2Controller(definition)).GenerateLogKey();
|
||||
|
||||
r.BaseStream.Position = firstFrameOffset;
|
||||
/*
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// Update the selected zone's key
|
||||
var lg = MovieSession.Movie.LogGeneratorInstance(MovieSession.MovieController);
|
||||
string key = lg.GenerateLogKey();
|
||||
key = key.Replace("LogKey:", "").Replace("#", "");
|
||||
key = key.Replace("#", "");
|
||||
|
||||
foreach (var box in _buttonBoxes)
|
||||
{
|
||||
|
@ -88,4 +88,4 @@ namespace BizHawk.Client.EmuHawk
|
|||
PositionBoxes();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
key = lg.GenerateLogKey();
|
||||
}
|
||||
|
||||
key = key.Replace("LogKey:", "").Replace("#", "");
|
||||
key = key.Replace("#", "");
|
||||
key = key.Substring(startIndex: 0, length: key.Length - 1); // drop last char
|
||||
|
||||
_inputKey = key;
|
||||
|
@ -40,7 +40,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var logGenerator = movieSession.Movie.LogGeneratorInstance(_controller);
|
||||
logGenerator.GenerateLogEntry(); // Reference and create all buttons.
|
||||
|
||||
string movieKey = logGenerator.GenerateLogKey().Replace("LogKey:", "").Replace("#", "");
|
||||
string movieKey = logGenerator.GenerateLogKey().Replace("#", "");
|
||||
movieKey = movieKey.Substring(startIndex: 0, length: movieKey.Length - 1); // drop last char
|
||||
if (key == movieKey)
|
||||
{
|
||||
|
@ -238,7 +238,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_inputKey = readText[0];
|
||||
var lg = _movieSession.Movie.LogGeneratorInstance(_movieSession.MovieController);
|
||||
string key = lg.GenerateLogKey();
|
||||
key = key.Replace("LogKey:", "").Replace("#", "");
|
||||
key = key.Replace("#", "");
|
||||
key = key.Substring(startIndex: 0, length: key.Length - 1); // drop last char
|
||||
string[] emuKeys = key.Split('|');
|
||||
string[] macroKeys = _inputKey.Split('|');
|
||||
|
|
Loading…
Reference in New Issue