From 52da42e62e4a88096984971a84157937961f5cef Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 11 Jan 2024 14:19:51 -0600 Subject: [PATCH] Add reload project menu button --- Source/Editor/Modules/UIModule.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Editor/Modules/UIModule.cs b/Source/Editor/Modules/UIModule.cs index 3386d411c..195df7728 100644 --- a/Source/Editor/Modules/UIModule.cs +++ b/Source/Editor/Modules/UIModule.cs @@ -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)