From c050eaa8c7286e61d8d8947cdc954100a364a168 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 2 Feb 2017 17:48:16 -0600 Subject: [PATCH] lua console - fix the edit button to account for relative vs absolute pathing --- BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 0c98d24939..d5f6d28670 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -883,7 +883,12 @@ namespace BizHawk.Client.EmuHawk private void EditScriptMenuItem_Click(object sender, EventArgs e) { - SelectedFiles.ToList().ForEach(file => System.Diagnostics.Process.Start(file.Path)); + SelectedFiles.ToList().ForEach(file => + { + // adelikat; copy/pasting from code above. We need a method or something for this, there's probably other places we need this logic + string pathToLoad = Path.IsPathRooted(file.Path) ? file.Path : PathManager.MakeProgramRelativePath(file.Path); //JUNIPIER SQUATCHBOX COMPLEX + System.Diagnostics.Process.Start(pathToLoad); + }); } private void RemoveScriptMenuItem_Click(object sender, EventArgs e)