Debugger: Lua - Fixed incorrect path for getScriptDataFolder for built-in scripts

This commit is contained in:
Sour 2019-12-25 16:15:07 -05:00
parent eb1f120539
commit 4906b12e2f

View File

@ -26,6 +26,7 @@ namespace Mesen.GUI.Debugger
private DateTime _lastTimestamp = DateTime.MinValue;
private AutocompleteMenu _popupMenu;
private string _originalText = "";
private string _builtInScriptName = null;
public frmScript(bool forceBlank = false)
{
@ -219,6 +220,7 @@ namespace Mesen.GUI.Debugger
this.Text = $"{name} - Script Window";
txtScriptContent.Text = ResourceManager.ReadZippedResource(name);
_originalText = txtScriptContent.Text;
_builtInScriptName = name;
txtScriptContent.ClearUndo();
}
@ -266,6 +268,8 @@ namespace Mesen.GUI.Debugger
{
if(_filePath != null) {
return Path.GetFileName(_filePath);
} else if(_builtInScriptName != null) {
return _builtInScriptName;
} else {
return "unnamed.lua";
}
@ -320,6 +324,7 @@ namespace Mesen.GUI.Debugger
ConfigManager.Config.DebugInfo.AddRecentScript(sfd.FileName);
UpdateRecentScripts();
_originalText = txtScriptContent.Text;
_builtInScriptName = null;
return true;
}
}