Update editor

This commit is contained in:
2026-02-03 21:49:14 +09:00
parent 9fcf06dbe4
commit 59991f47d5
88 changed files with 1157 additions and 1288 deletions

View File

@@ -1,26 +0,0 @@
using Microsoft.UI.Xaml;
namespace Ghost.Editor.Core.Utilities;
public static class EditorApplication
{
private static IServiceProvider? _serviceProvider;
public static Application Current => Application.Current;
internal static void Initialize(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
}
public static T GetService<T>()
where T : class
{
if (_serviceProvider?.GetService(typeof(T)) is not T service)
{
throw new ArgumentException($"{typeof(T)} needs to be registered in ConfigureServices within App.xaml.cs.");
}
return service;
}
}

View File

@@ -1,12 +1,10 @@
using Ghost.Data.Models;
namespace Ghost.Editor.Core.Utilities;
internal static class FileExtensions
{
public const string META_FILE_EXTENSION = ".gmeta";
public const string PROJECT_FILE_EXTENSION = "." + ProjectMetadata.PROJECT_FILE_EXTENSION_NAME;
public const string PROJECT_FILE_EXTENSION = ".gproj";
public const string TEMPLATE_FILE_EXTENSION = ".gtmpl";
public const string SCENE_FILE_EXTENSION = ".gscene";
public const string ASSET_FILE_EXTENSION = ".gasset";

View File

@@ -29,6 +29,12 @@ public static class TypeCache
s_types = loadableTypes.Select(t => t.GetTypeInfo()).ToArray();
}
internal static void Init()
{
// Intentionally left blank.
// This method exists to force the static constructor to run.
}
public static Type[] GetTypes()
{
return s_types;