This commit is contained in:
Jan Racek
2026-03-24 13:00:54 +01:00
parent 53e993f58e
commit 4aa4e49424
145 changed files with 10853 additions and 2965 deletions

View File

@@ -1,21 +1,39 @@
using UnityEditor;
using UnityEditor.Callbacks;
[InitializeOnLoad]
public static class DependencyCheckInitializer
namespace SplashEdit.EditorCode
{
static DependencyCheckInitializer()
/// <summary>
/// Automatically opens the SplashEdit Control Panel on the first editor
/// session if the MIPS toolchain has not been installed yet.
/// </summary>
[InitializeOnLoad]
public static class DependencyCheckInitializer
{
EditorApplication.update += OpenInstallerOnStart;
}
private const string SessionKey = "SplashEditOpenedThisSession";
private static void OpenInstallerOnStart()
{
EditorApplication.update -= OpenInstallerOnStart;
if (!SessionState.GetBool("InstallerWindowOpened", false))
static DependencyCheckInitializer()
{
InstallerWindow.ShowWindow();
SessionState.SetBool("InstallerWindowOpened", true); // only once per session
EditorApplication.update += OpenControlPanelOnStart;
}
private static void OpenControlPanelOnStart()
{
EditorApplication.update -= OpenControlPanelOnStart;
if (SessionState.GetBool(SessionKey, false))
return;
SessionState.SetBool(SessionKey, true);
// Only auto-open the Control Panel when the toolchain is missing
bool toolchainReady = ToolchainChecker.IsToolAvailable("mips") ||
ToolchainChecker.IsToolAvailable("mipsel-none-elf-gcc") ||
ToolchainChecker.IsToolAvailable("mipsel-linux-gnu-gcc");
if (!toolchainReady)
{
SplashControlPanel.ShowWindow();
}
}
}
}
}