From d3c4e6040556b85990eadea489284ff3ffdf9721 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 31 May 2020 11:50:52 -0500 Subject: [PATCH] Lua File list - Simplify save/load method names --- src/BizHawk.Client.Common/lua/LuaFileList.cs | 4 ++-- src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/BizHawk.Client.Common/lua/LuaFileList.cs b/src/BizHawk.Client.Common/lua/LuaFileList.cs index daea20c2a0..51b0d99c4a 100644 --- a/src/BizHawk.Client.Common/lua/LuaFileList.cs +++ b/src/BizHawk.Client.Common/lua/LuaFileList.cs @@ -56,7 +56,7 @@ namespace BizHawk.Client.Common return base.Remove(item); } - public bool LoadLuaSession(string path, bool disableOnLoad) + public bool Load(string path, bool disableOnLoad) { var file = new FileInfo(path); if (!file.Exists) @@ -95,7 +95,7 @@ namespace BizHawk.Client.Common return true; } - public void SaveSession(string path) + public void Save(string path) { using var sw = new StreamWriter(path); var sb = new StringBuilder(); diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 00c4d1d8a1..a6eee7a8b3 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -512,7 +512,7 @@ namespace BizHawk.Client.EmuHawk public bool LoadLuaSession(string path) { - var result = LuaImp.ScriptList.LoadLuaSession(path, Settings.DisableLuaScriptsOnLoad); + var result = LuaImp.ScriptList.Load(path, Settings.DisableLuaScriptsOnLoad); RunLuaScripts(); UpdateDialog(); @@ -660,7 +660,7 @@ namespace BizHawk.Client.EmuHawk var path = Config.PathEntries .AbsolutePathFor(file.FullName, "") .MakeRelativeTo(Path.GetDirectoryName(file.FullName)); - LuaImp.ScriptList.SaveSession(path); + LuaImp.ScriptList.Save(path); Config.RecentLuaSession.Add(file.FullName); // TODO: should path be used here? OutputMessages.Text = $"{Path.GetFileName(LuaImp.ScriptList.Filename)} saved."; @@ -727,7 +727,7 @@ namespace BizHawk.Client.EmuHawk { if (!string.IsNullOrWhiteSpace(LuaImp.ScriptList.Filename)) { - LuaImp.ScriptList.SaveSession(LuaImp.ScriptList.Filename); + LuaImp.ScriptList.Save(LuaImp.ScriptList.Filename); Config.RecentLuaSession.Add(LuaImp.ScriptList.Filename); } else