mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-11-04 12:51:48 +00:00
Show popup when trying to open script project with no IDE selected
This commit is contained in:
@@ -604,7 +604,7 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
if (ImGui.MenuItem("Open C# Project..."))
|
||||
{
|
||||
Editor.Instance.IdeAdapter.OpenScriptProject();
|
||||
Editor.Instance.OpenScriptProject();
|
||||
}
|
||||
|
||||
ImGui.AttachTooltip("Opens the C# Solution of this project.");
|
||||
@@ -1434,7 +1434,7 @@ namespace GlitchyEditor.EditWindows
|
||||
// Special treatment for scripts, open them in Visual Studio.
|
||||
if (entry->Path.EndsWith(".cs"))
|
||||
{
|
||||
Editor.Instance.IdeAdapter.OpenScript(entry->Path);
|
||||
Editor.Instance.OpenScript(entry->Path);
|
||||
}
|
||||
else if (Path.OpenFolder(entry->Path) case .Err)
|
||||
Log.EngineLogger.Error("Failed to open file.");
|
||||
|
||||
@@ -178,16 +178,11 @@ namespace GlitchyEditor
|
||||
_settingsWindow.Open = true;
|
||||
}
|
||||
|
||||
/// Wrapper for IdeAdapter.OpenScript that check whether or not an IDE Adapter is configured.
|
||||
/// If not, a popup will be show.
|
||||
public void OpenScript(StringView fileName, int lineNumber = 0, int columnNumber = 0)
|
||||
{
|
||||
if (IdeAdapter == null)
|
||||
{
|
||||
private void OpenIdeConfigurationPopup() {
|
||||
PopupService.Instance.OpenPopup("No IDE configured.", new (close) => {
|
||||
close = false;
|
||||
|
||||
ImGui.TextUnformatted("In order to open a source file you need to configure an IDE to use.");
|
||||
ImGui.TextUnformatted("In order to open a source file or the script project you need to configure an IDE to use.");
|
||||
|
||||
if (ImGui.Button("Go to settings..."))
|
||||
{
|
||||
@@ -204,10 +199,33 @@ namespace GlitchyEditor
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// Wrapper for IdeAdapter.OpenScript that check whether or not an IDE Adapter is configured.
|
||||
/// If not, a popup will be show.
|
||||
public void OpenScript(StringView fileName, int lineNumber = 0, int columnNumber = 0)
|
||||
{
|
||||
if (IdeAdapter == null)
|
||||
{
|
||||
OpenIdeConfigurationPopup();
|
||||
}
|
||||
else
|
||||
{
|
||||
IdeAdapter.OpenScript(fileName, lineNumber, columnNumber);
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper for IdeAdapter.OpenScript that check whether or not an IDE Adapter is configured.
|
||||
/// If not, a popup will be show.
|
||||
public void OpenScriptProject()
|
||||
{
|
||||
if (IdeAdapter == null)
|
||||
{
|
||||
OpenIdeConfigurationPopup();
|
||||
}
|
||||
else
|
||||
{
|
||||
IdeAdapter.OpenScriptProject();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user