Add reload project menu button

This commit is contained in:
Chandler Cox
2024-01-11 14:19:51 -06:00
parent 1094abce5a
commit 52da42e62e

View File

@@ -535,6 +535,7 @@ namespace FlaxEditor.Modules
_menuFileRecompileScripts = cm.AddButton("Recompile scripts", inputOptions.RecompileScripts, ScriptsBuilder.Compile);
cm.AddSeparator();
cm.AddButton("Open project...", OpenProject);
cm.AddButton("Reload project", ReloadProject);
cm.AddSeparator();
cm.AddButton("Exit", "Alt+F4", () => Editor.Windows.MainWindow.Close(ClosingReason.User));
@@ -822,6 +823,13 @@ namespace FlaxEditor.Modules
}
}
private void ReloadProject()
{
// Open project, then close it
Editor.OpenProject(Editor.GameProject.ProjectPath);
Editor.Windows.MainWindow.Close(ClosingReason.User);
}
private void OnMenuFileShowHide(Control control)
{
if (control.Visible == false)