Update ContextFlyout
This commit is contained in:
@@ -2,7 +2,7 @@ using Ghost.Core;
|
||||
|
||||
namespace Ghost.Editor.Core.AssetHandle;
|
||||
|
||||
public static partial class AssetDatabase
|
||||
public static partial class AssetService
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new asset at the specified path.
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Reflection;
|
||||
|
||||
namespace Ghost.Editor.Core.AssetHandle;
|
||||
|
||||
public static partial class AssetDatabase
|
||||
public static partial class AssetService
|
||||
{
|
||||
private static readonly Dictionary<Type, AssetImporter> s_importerInstances = new();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Text.Json;
|
||||
|
||||
namespace Ghost.Editor.Core.AssetHandle;
|
||||
|
||||
public static partial class AssetDatabase
|
||||
public static partial class AssetService
|
||||
{
|
||||
// Asset cache - stores loaded assets by GUID
|
||||
private static readonly ConcurrentDictionary<Guid, Asset> s_assetCache = new();
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Text.Json;
|
||||
|
||||
namespace Ghost.Editor.Core.AssetHandle;
|
||||
|
||||
public static partial class AssetDatabase
|
||||
public static partial class AssetService
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the relative path from the assets directory.
|
||||
@@ -96,7 +96,7 @@ public static partial class AssetDatabase
|
||||
/// <returns>The loaded asset.</returns>
|
||||
public static Result<T> LoadAsset<T>(Guid guid) where T : Asset
|
||||
{
|
||||
// Implemented in AssetDatabase.Loader.cs
|
||||
// Implemented in AssetService.Loader.cs
|
||||
return LoadAssetInternal<T>(guid);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Text.Json;
|
||||
|
||||
namespace Ghost.Editor.Core.AssetHandle;
|
||||
|
||||
public static partial class AssetDatabase
|
||||
public static partial class AssetService
|
||||
{
|
||||
private static readonly Dictionary<string, Type> s_importerTypeLookup = new();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Reflection;
|
||||
|
||||
namespace Ghost.Editor.Core.AssetHandle;
|
||||
|
||||
public static partial class AssetDatabase
|
||||
public static partial class AssetService
|
||||
{
|
||||
private static readonly Dictionary<string, Action<string>> s_assetOpenHandlers = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Text.Json;
|
||||
|
||||
namespace Ghost.Editor.Core.AssetHandle;
|
||||
|
||||
public static partial class AssetDatabase
|
||||
public static partial class AssetService
|
||||
{
|
||||
private static SqliteConnection? s_dbConnection;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ internal readonly record struct AssetCommand(
|
||||
/// Handles asset registration, lookup, importing, and dependency management.
|
||||
/// Uses SQLite for persistent storage and efficient querying.
|
||||
/// </summary>
|
||||
public static partial class AssetDatabase
|
||||
public static partial class AssetService
|
||||
{
|
||||
private static FileSystemWatcher? s_watcher;
|
||||
private static readonly Lock s_dbLock = new();
|
||||
@@ -47,7 +47,6 @@ public static partial class AssetDatabase
|
||||
// Command buffer pattern - Channel for file system event commands
|
||||
private static Channel<AssetCommand>? s_commandChannel;
|
||||
private static Timer? s_commandProcessorTimer;
|
||||
private static readonly Lock s_commandLock = new();
|
||||
private static readonly ConcurrentQueue<AssetCommand> s_waitingCommands = new(); // Commands waiting for manual refresh
|
||||
private static bool s_autoRefreshEnabled = true;
|
||||
|
||||
@@ -56,7 +55,7 @@ public static partial class AssetDatabase
|
||||
private static bool s_initialized = false;
|
||||
|
||||
private static readonly TimeSpan s_debounceDelay = TimeSpan.FromMilliseconds(100);
|
||||
private static ManualResetEventSlim s_resetEventSlim = new(false);
|
||||
private static readonly ManualResetEventSlim s_resetEventSlim = new(false);
|
||||
|
||||
private static readonly JsonSerializerOptions s_defaultJsonOptions = new()
|
||||
{
|
||||
@@ -78,7 +77,6 @@ public static partial class AssetDatabase
|
||||
/// Initialize the asset database.
|
||||
/// Must be called after project is loaded.
|
||||
/// </summary>
|
||||
|
||||
internal static async Task Initialize(CancellationToken token = default)
|
||||
{
|
||||
lock (s_initializationLock)
|
||||
|
||||
@@ -39,7 +39,7 @@ public abstract class AssetImporter
|
||||
{
|
||||
foreach (var dependencyGuid in dependencies)
|
||||
{
|
||||
var path = AssetDatabase.GuidToPath(dependencyGuid);
|
||||
var path = AssetService.GuidToPath(dependencyGuid);
|
||||
if (path.IsFailure)
|
||||
{
|
||||
return ValueTask.FromResult(Result.Failure($"Missing dependency: {dependencyGuid}"));
|
||||
|
||||
@@ -134,7 +134,7 @@ internal class TextureImporter : AssetImporter<TextureImporterSettings>
|
||||
};
|
||||
|
||||
// Save the imported asset data
|
||||
var saveResult = AssetDatabase.SaveImportedAsset(meta.Guid, textureAsset);
|
||||
var saveResult = AssetService.SaveImportedAsset(meta.Guid, textureAsset);
|
||||
if (saveResult.IsFailure)
|
||||
{
|
||||
return Result.Failure($"Failed to save texture asset: {saveResult.Message}");
|
||||
|
||||
Reference in New Issue
Block a user