Allow writing to user gamedb in NixHawk
not that any cores have a working implementation yet, see #733
This commit is contained in:
parent
d466c2694f
commit
0410a4f291
|
@ -7,7 +7,6 @@ using System.Windows.Forms;
|
|||
using BizHawk.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Common.PathExtensions;
|
||||
|
||||
// todo - perks - pause, copy to clipboard, backlog length limiting
|
||||
|
||||
|
@ -187,7 +186,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
var gameDbEntry = Emulator.AsGameDBEntryGenerator().GenerateGameDbEntry();
|
||||
gameDbEntry.Status = picker.PickedStatus;
|
||||
Database.SaveDatabaseEntry(Path.Combine(PathUtils.ExeDirectoryPath, "gamedb", "gamedb_user.txt"), gameDbEntry); //TODO read-only in Nix builds
|
||||
Database.SaveDatabaseEntry(gameDbEntry);
|
||||
MainForm.UpdateDumpInfo(gameDbEntry.Status);
|
||||
HideShowGameDbButton();
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Common
|
|||
}
|
||||
}
|
||||
|
||||
public static void SaveDatabaseEntry(string path, CompactGameInfo gameInfo)
|
||||
public static void SaveDatabaseEntry(CompactGameInfo gameInfo, string filename = "gamedb_user.txt")
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb
|
||||
|
@ -96,7 +96,8 @@ namespace BizHawk.Emulation.Common
|
|||
.Append(gameInfo.MetaData)
|
||||
.Append(Environment.NewLine);
|
||||
|
||||
File.AppendAllText(path, sb.ToString());
|
||||
File.AppendAllText(Path.Combine(_userRoot, filename), sb.ToString());
|
||||
DB[gameInfo.Hash] = gameInfo;
|
||||
}
|
||||
|
||||
private static bool initialized = false;
|
||||
|
|
Loading…
Reference in New Issue