Refactor AssetHandlerRegistry, modernize editor window UI
Refactored AssetHandlerRegistry to a static class and updated all usages. Replaced the docking-based EngineEditorWindow with a new grid/panel layout, adding modern toolbar, menu bar, and status bar. Introduced new divider styles and improved UI details. Removed obsolete and unused files, updated project references, and made minor code and UI/UX improvements.
This commit is contained in:
@@ -4,32 +4,32 @@ namespace Ghost.Editor.Core.AssetHandler;
|
|||||||
/// One-time scan at editor startup → two dictionaries.
|
/// One-time scan at editor startup → two dictionaries.
|
||||||
/// All lookups are O(1) after construction.
|
/// All lookups are O(1) after construction.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class AssetHandlerRegistry
|
public static class AssetHandlerRegistry
|
||||||
{
|
{
|
||||||
private readonly Dictionary<string, IAssetHandler> _byExtension;
|
private static readonly Dictionary<string, IAssetHandler> s_byExtension;
|
||||||
private readonly Dictionary<Guid, IAssetHandler> _byTypeId;
|
private static readonly Dictionary<Guid, IAssetHandler> s_byTypeId;
|
||||||
private readonly Dictionary<Guid, int> _versionByTypeId;
|
private static readonly Dictionary<Guid, int> s_versionByTypeId;
|
||||||
|
|
||||||
public AssetHandlerRegistry()
|
static AssetHandlerRegistry()
|
||||||
{
|
{
|
||||||
_byExtension = new Dictionary<string, IAssetHandler>(StringComparer.OrdinalIgnoreCase);
|
s_byExtension = new Dictionary<string, IAssetHandler>(StringComparer.OrdinalIgnoreCase);
|
||||||
_byTypeId = new Dictionary<Guid, IAssetHandler>();
|
s_byTypeId = new Dictionary<Guid, IAssetHandler>();
|
||||||
_versionByTypeId = new Dictionary<Guid, int>();
|
s_versionByTypeId = new Dictionary<Guid, int>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterHandler(IAssetHandler handler, Guid typeId, ReadOnlySpan<string> extensions, int version)
|
public static void RegisterHandler(IAssetHandler handler, Guid typeId, ReadOnlySpan<string> extensions, int version)
|
||||||
{
|
{
|
||||||
_byTypeId[typeId] = handler;
|
s_byTypeId[typeId] = handler;
|
||||||
_versionByTypeId[typeId] = version;
|
s_versionByTypeId[typeId] = version;
|
||||||
|
|
||||||
foreach (var ext in extensions)
|
foreach (var ext in extensions)
|
||||||
{
|
{
|
||||||
var normalizedExt = ext.StartsWith('.') ? ext : "." + ext;
|
var normalizedExt = ext.StartsWith('.') ? ext : "." + ext;
|
||||||
_byExtension[normalizedExt] = handler;
|
s_byExtension[normalizedExt] = handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IAssetHandler? GetByExtension(string extension)
|
public static IAssetHandler? GetByExtension(string extension)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(extension))
|
if (string.IsNullOrEmpty(extension))
|
||||||
{
|
{
|
||||||
@@ -37,21 +37,24 @@ public sealed class AssetHandlerRegistry
|
|||||||
}
|
}
|
||||||
|
|
||||||
var normalized = extension.StartsWith('.') ? extension : "." + extension;
|
var normalized = extension.StartsWith('.') ? extension : "." + extension;
|
||||||
_byExtension.TryGetValue(normalized, out var handler);
|
s_byExtension.TryGetValue(normalized, out var handler);
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IAssetHandler? GetByTypeId(Guid typeId)
|
public static IAssetHandler? GetByTypeId(Guid typeId)
|
||||||
{
|
{
|
||||||
_byTypeId.TryGetValue(typeId, out var handler);
|
s_byTypeId.TryGetValue(typeId, out var handler);
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetVersionByTypeId(Guid typeId)
|
public static int GetVersionByTypeId(Guid typeId)
|
||||||
{
|
{
|
||||||
_versionByTypeId.TryGetValue(typeId, out var version);
|
s_versionByTypeId.TryGetValue(typeId, out var version);
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<string> GetSupportedExtensions() => _byExtension.Keys;
|
public static IEnumerable<string> GetSupportedExtensions()
|
||||||
|
{
|
||||||
|
return s_byExtension.Keys;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ internal sealed class AssetRegistry : IAssetRegistry, IDisposable
|
|||||||
private readonly string _assetsRoot;
|
private readonly string _assetsRoot;
|
||||||
private readonly string _libraryRoot;
|
private readonly string _libraryRoot;
|
||||||
private readonly AssetCatalog _catalog;
|
private readonly AssetCatalog _catalog;
|
||||||
private readonly AssetHandlerRegistry _handlerRegistry;
|
|
||||||
private readonly ImportCoordinator _importCoordinator;
|
private readonly ImportCoordinator _importCoordinator;
|
||||||
private readonly FileSystemWatcher _watcher;
|
private readonly FileSystemWatcher _watcher;
|
||||||
|
|
||||||
@@ -36,8 +35,7 @@ internal sealed class AssetRegistry : IAssetRegistry, IDisposable
|
|||||||
var dbPath = Path.Combine(_libraryRoot, "AssetDB.sqlite");
|
var dbPath = Path.Combine(_libraryRoot, "AssetDB.sqlite");
|
||||||
|
|
||||||
_catalog = new AssetCatalog(dbPath);
|
_catalog = new AssetCatalog(dbPath);
|
||||||
_handlerRegistry = new AssetHandlerRegistry();
|
_importCoordinator = new ImportCoordinator(_catalog, _assetsRoot, _libraryRoot);
|
||||||
_importCoordinator = new ImportCoordinator(_catalog, _handlerRegistry, _assetsRoot, _libraryRoot);
|
|
||||||
|
|
||||||
_loadedAssets = new ConcurrentDictionary<Guid, WeakReference<Asset>>();
|
_loadedAssets = new ConcurrentDictionary<Guid, WeakReference<Asset>>();
|
||||||
|
|
||||||
@@ -156,8 +154,11 @@ internal sealed class AssetRegistry : IAssetRegistry, IDisposable
|
|||||||
{
|
{
|
||||||
var ext = Path.GetExtension(relativePath);
|
var ext = Path.GetExtension(relativePath);
|
||||||
|
|
||||||
var handler = _handlerRegistry.GetByExtension(ext);
|
var handler = AssetHandlerRegistry.GetByExtension(ext);
|
||||||
var importable = handler as IAssetHandler;
|
if (handler is null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var metaPath = AssetMetaIO.GetMetaPath(fullPath);
|
var metaPath = AssetMetaIO.GetMetaPath(fullPath);
|
||||||
if (File.Exists(metaPath))
|
if (File.Exists(metaPath))
|
||||||
@@ -171,7 +172,7 @@ internal sealed class AssetRegistry : IAssetRegistry, IDisposable
|
|||||||
Guid = Guid.NewGuid(),
|
Guid = Guid.NewGuid(),
|
||||||
HandlerTypeId = handlerTypeId is string str ? Guid.Parse(str) : null,
|
HandlerTypeId = handlerTypeId is string str ? Guid.Parse(str) : null,
|
||||||
HandlerVersion = 1,
|
HandlerVersion = 1,
|
||||||
Settings = importable?.CreateDefaultSettings()
|
Settings = handler?.CreateDefaultSettings()
|
||||||
};
|
};
|
||||||
|
|
||||||
_ignoreMetaWrites[metaPath] = true;
|
_ignoreMetaWrites[metaPath] = true;
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ internal sealed class ImportCoordinator : IDisposable
|
|||||||
{
|
{
|
||||||
private readonly Channel<ImportJob> _importChannel;
|
private readonly Channel<ImportJob> _importChannel;
|
||||||
private readonly AssetCatalog _catalog;
|
private readonly AssetCatalog _catalog;
|
||||||
private readonly AssetHandlerRegistry _handlers;
|
|
||||||
private readonly string _assetsRoot;
|
private readonly string _assetsRoot;
|
||||||
private readonly string _libraryRoot;
|
private readonly string _libraryRoot;
|
||||||
private readonly CancellationTokenSource _cts;
|
private readonly CancellationTokenSource _cts;
|
||||||
@@ -37,10 +36,9 @@ internal sealed class ImportCoordinator : IDisposable
|
|||||||
// For now we just focus on the core logic
|
// For now we just focus on the core logic
|
||||||
// public event EventHandler<AssetChangedEventArgs>? OnAssetChanged;
|
// public event EventHandler<AssetChangedEventArgs>? OnAssetChanged;
|
||||||
|
|
||||||
public ImportCoordinator(AssetCatalog catalog, AssetHandlerRegistry handlers, string assetsRoot, string libraryRoot, int workerCount = 2)
|
public ImportCoordinator(AssetCatalog catalog, string assetsRoot, string libraryRoot, int workerCount = 2)
|
||||||
{
|
{
|
||||||
_catalog = catalog;
|
_catalog = catalog;
|
||||||
_handlers = handlers;
|
|
||||||
_assetsRoot = assetsRoot;
|
_assetsRoot = assetsRoot;
|
||||||
_libraryRoot = libraryRoot;
|
_libraryRoot = libraryRoot;
|
||||||
_cts = new CancellationTokenSource();
|
_cts = new CancellationTokenSource();
|
||||||
@@ -98,8 +96,8 @@ internal sealed class ImportCoordinator : IDisposable
|
|||||||
}
|
}
|
||||||
|
|
||||||
var handler = meta.HandlerTypeId.HasValue
|
var handler = meta.HandlerTypeId.HasValue
|
||||||
? _handlers.GetByTypeId(meta.HandlerTypeId.Value)
|
? AssetHandlerRegistry.GetByTypeId(meta.HandlerTypeId.Value)
|
||||||
: _handlers.GetByExtension(Path.GetExtension(job.SourcePath));
|
: AssetHandlerRegistry.GetByExtension(Path.GetExtension(job.SourcePath));
|
||||||
|
|
||||||
var contentHash = await ComputeFileHashAsync(fullSourcePath, token);
|
var contentHash = await ComputeFileHashAsync(fullSourcePath, token);
|
||||||
var settingsHash = ComputeSettingsHash(meta.Settings);
|
var settingsHash = ComputeSettingsHash(meta.Settings);
|
||||||
@@ -108,7 +106,7 @@ internal sealed class ImportCoordinator : IDisposable
|
|||||||
if (job.Reason != ImportReason.ManualReimport &&
|
if (job.Reason != ImportReason.ManualReimport &&
|
||||||
meta.ContentHash == contentHash &&
|
meta.ContentHash == contentHash &&
|
||||||
meta.SettingsHash == settingsHash &&
|
meta.SettingsHash == settingsHash &&
|
||||||
meta.HandlerVersion == _handlers.GetVersionByTypeId(meta.HandlerTypeId ?? Guid.Empty))
|
meta.HandlerVersion == AssetHandlerRegistry.GetVersionByTypeId(meta.HandlerTypeId ?? Guid.Empty))
|
||||||
{
|
{
|
||||||
_catalog.MarkImported(job.AssetGuid, contentHash, settingsHash);
|
_catalog.MarkImported(job.AssetGuid, contentHash, settingsHash);
|
||||||
return;
|
return;
|
||||||
@@ -132,7 +130,7 @@ internal sealed class ImportCoordinator : IDisposable
|
|||||||
{
|
{
|
||||||
meta.ContentHash = contentHash;
|
meta.ContentHash = contentHash;
|
||||||
meta.SettingsHash = settingsHash;
|
meta.SettingsHash = settingsHash;
|
||||||
meta.HandlerVersion = _handlers.GetVersionByTypeId(meta.HandlerTypeId ?? Guid.Empty);
|
meta.HandlerVersion = AssetHandlerRegistry.GetVersionByTypeId(meta.HandlerTypeId ?? Guid.Empty);
|
||||||
meta.LastImportedUtc = DateTime.UtcNow;
|
meta.LastImportedUtc = DateTime.UtcNow;
|
||||||
|
|
||||||
await AssetMetaIO.WriteAsync(job.MetaPath, meta, token);
|
await AssetMetaIO.WriteAsync(job.MetaPath, meta, token);
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
using Ghost.Editor.Core.AssetHandler;
|
|
||||||
using System.Buffers;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ghost.Editor.Core.Utilities;
|
|
||||||
|
|
||||||
public static class AssetHandlerUtility
|
|
||||||
{
|
|
||||||
public static async ValueTask SerializeAssetAsync<TSetting>(Stream stream, Guid id, Guid typeID, int handlerVersion, ReadOnlyMemory<Guid> dependencies, IAssetSettings? settings, ReadOnlyMemory<byte> contents, CancellationToken token = default)
|
|
||||||
where TSetting : IAssetSettings
|
|
||||||
{
|
|
||||||
var header = new AssetMetadata(id, TextureAsset.s_typeGuid)
|
|
||||||
{
|
|
||||||
HandlerVersion = handlerVersion,
|
|
||||||
DependenciesOffset = AssetMetadata.SIZE,
|
|
||||||
DependencyCount = dependencies.Length,
|
|
||||||
};
|
|
||||||
|
|
||||||
var tempArray = ArrayPool<byte>.Shared.Rent(4096);
|
|
||||||
|
|
||||||
if (dependencies.Length > 0)
|
|
||||||
{
|
|
||||||
stream.Seek(header.DependenciesOffset, SeekOrigin.Begin);
|
|
||||||
for (var i = 0; i < dependencies.Length; i++)
|
|
||||||
{
|
|
||||||
Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(tempArray.AsSpan(0, 16)), dependencies.Span[i]);
|
|
||||||
await stream.WriteAsync(tempArray.AsMemory(0, 16), token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
header.SettingsOffset = stream.Position;
|
|
||||||
|
|
||||||
// TODO: We can use source generator to generate optimized serializer for settings.
|
|
||||||
// For now, we just use reflection for simplicity.
|
|
||||||
|
|
||||||
if (settings is not null)
|
|
||||||
{
|
|
||||||
var properties = typeof(TSetting).GetProperties();
|
|
||||||
|
|
||||||
if (properties.Length > 0)
|
|
||||||
{
|
|
||||||
using var bw = new BinaryWriter(stream);
|
|
||||||
|
|
||||||
for (var i = 0; (i < properties.Length); i++)
|
|
||||||
{
|
|
||||||
var property = properties[i];
|
|
||||||
var value = property.GetValue(settings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -58,6 +58,8 @@ internal static class ActivationHandler
|
|||||||
{
|
{
|
||||||
ArenaCapacity = 1024 * 1024 * 1024, // 1 GB. Arena using virtual memory, so this is just a reservation and won't actually consume physical memory until used.
|
ArenaCapacity = 1024 * 1024 * 1024, // 1 GB. Arena using virtual memory, so this is just a reservation and won't actually consume physical memory until used.
|
||||||
StackCapacity = 1024 * 1024 * 32, // 32 MB. Stack using virtual memory, so this is just a reservation and won't actually consume physical memory until used.
|
StackCapacity = 1024 * 1024 * 32, // 32 MB. Stack using virtual memory, so this is just a reservation and won't actually consume physical memory until used.
|
||||||
|
FreeListChunkSize = 64 * 1024 * 1024,
|
||||||
|
FreeListDefaultAlignment = 8,
|
||||||
FreeListConcurrencyLevel = Environment.ProcessorCount
|
FreeListConcurrencyLevel = Environment.ProcessorCount
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||||
<ResourceDictionary Source="/Themes/Generic.xaml" />
|
<ResourceDictionary Source="/Themes/Generic.xaml" />
|
||||||
<ResourceDictionary Source="/Themes/DockingDictionary.xaml" />
|
<!--<ResourceDictionary Source="/Themes/DockingDictionary.xaml" />-->
|
||||||
<core:ControlsDictionary />
|
<core:ControlsDictionary />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
<langversion>preview</langversion>
|
<langversion>preview</langversion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="View\Controls\Hierarchy.xaml" />
|
<None Remove="Views\Controls\Hierarchy.xaml" />
|
||||||
<None Remove="View\Windows\BlankWindow1.xaml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||||
@@ -142,6 +141,9 @@
|
|||||||
<None Update="Assets\icon.ico">
|
<None Update="Assets\icon.ico">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<Page Update="Views\Windows\EngineEditorWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Update="View\Windows\BlankWindow1.xaml">
|
<Page Update="View\Windows\BlankWindow1.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
</Style>
|
</Style>
|
||||||
<x:Double x:Key="ControlContentThemeFontSize">12</x:Double>
|
<x:Double x:Key="ControlContentThemeFontSize">12</x:Double>
|
||||||
<x:Double x:Key="ContentControlFontSize">12</x:Double>
|
<x:Double x:Key="ContentControlFontSize">12</x:Double>
|
||||||
|
<x:Double x:Key="ToolbarFontIconFontSize">14</x:Double>
|
||||||
<x:Double x:Key="TextControlThemeMinHeight">24</x:Double>
|
<x:Double x:Key="TextControlThemeMinHeight">24</x:Double>
|
||||||
<Thickness x:Key="TextControlThemePadding">2,2,6,1</Thickness>
|
<Thickness x:Key="TextControlThemePadding">2,2,6,1</Thickness>
|
||||||
<x:Double x:Key="ListViewItemMinHeight">32</x:Double>
|
<x:Double x:Key="ListViewItemMinHeight">32</x:Double>
|
||||||
@@ -54,6 +55,18 @@
|
|||||||
BasedOn="{StaticResource SubtleButtonStyle}"
|
BasedOn="{StaticResource SubtleButtonStyle}"
|
||||||
TargetType="Button" />
|
TargetType="Button" />
|
||||||
|
|
||||||
|
<Style x:Key="VerticalDivider" TargetType="Border">
|
||||||
|
<Setter Property="BorderBrush" Value="{ThemeResource DividerStrokeColorDefaultBrush}" />
|
||||||
|
<Setter Property="BorderThickness" Value="1,0,0,0" />
|
||||||
|
<Setter Property="Margin" Value="2,0" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="HorizontalDivider" TargetType="Border">
|
||||||
|
<Setter Property="BorderBrush" Value="{ThemeResource DividerStrokeColorDefaultBrush}" />
|
||||||
|
<Setter Property="BorderThickness" Value="0,1,0,0" />
|
||||||
|
<Setter Property="Margin" Value="0,2" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
<!-- Named Resource -->
|
<!-- Named Resource -->
|
||||||
<x:Double x:Key="ToolbarIconSize">12</x:Double>
|
<x:Double x:Key="ToolbarIconSize">12</x:Double>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace Ghost.Editor.ViewModels.Pages.EngineEditor;
|
|||||||
|
|
||||||
internal partial class ConsoleViewModel : ObservableObject
|
internal partial class ConsoleViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
public ReadOnlyObservableCollection<LogMessage> Logs => Logger.Logs;
|
public ReadOnlyObservableCollection<LogMessage> Logs;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
public partial bool ShowInfo
|
public partial bool ShowInfo
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<Window
|
|
||||||
x:Class="Ghost.Editor.Views.Windows.BlankWindow1"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:local="using:Ghost.Editor.Views.Windows"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
Title="BlankWindow1"
|
|
||||||
mc:Ignorable="d">
|
|
||||||
|
|
||||||
<Window.SystemBackdrop>
|
|
||||||
<MicaBackdrop />
|
|
||||||
</Window.SystemBackdrop>
|
|
||||||
|
|
||||||
<Grid />
|
|
||||||
</Window>
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.UI.Xaml;
|
|
||||||
using Microsoft.UI.Xaml.Controls;
|
|
||||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
|
||||||
using Microsoft.UI.Xaml.Data;
|
|
||||||
using Microsoft.UI.Xaml.Input;
|
|
||||||
using Microsoft.UI.Xaml.Media;
|
|
||||||
using Microsoft.UI.Xaml.Navigation;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices.WindowsRuntime;
|
|
||||||
using Windows.Foundation;
|
|
||||||
using Windows.Foundation.Collections;
|
|
||||||
|
|
||||||
// To learn more about WinUI, the WinUI project structure,
|
|
||||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
|
||||||
|
|
||||||
namespace Ghost.Editor.Views.Windows;
|
|
||||||
/// <summary>
|
|
||||||
/// An empty window that can be used on its own or navigated to within a Frame.
|
|
||||||
/// </summary>
|
|
||||||
public sealed partial class BlankWindow1 : Window
|
|
||||||
{
|
|
||||||
public BlankWindow1()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,244 +3,491 @@
|
|||||||
x:Class="Ghost.Editor.Views.Windows.EngineEditorWindow"
|
x:Class="Ghost.Editor.Views.Windows.EngineEditorWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors"
|
|
||||||
xmlns:controls="using:Ghost.Editor.Views.Controls"
|
|
||||||
xmlns:ctc="using:CommunityToolkit.WinUI.Controls"
|
xmlns:ctc="using:CommunityToolkit.WinUI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:ee="using:Ghost.Editor.Views.Pages.EngineEditor"
|
|
||||||
xmlns:ghost="using:Ghost.Editor.Controls"
|
|
||||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
|
||||||
xmlns:local="using:Ghost.Editor.Views.Windows"
|
xmlns:local="using:Ghost.Editor.Views.Windows"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:winex="using:WinUIEx"
|
xmlns:winex="using:WinUIEx"
|
||||||
|
Title="EditorWindow"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Window.SystemBackdrop>
|
<winex:WindowEx.SystemBackdrop>
|
||||||
<MicaBackdrop />
|
<MicaBackdrop />
|
||||||
</Window.SystemBackdrop>
|
</winex:WindowEx.SystemBackdrop>
|
||||||
|
|
||||||
<Grid Loaded="MainGrid_Loaded" Unloaded="MainGrid_Unloaded">
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Titlebar -->
|
<!-- Title Bar -->
|
||||||
<TitleBar
|
<StackPanel
|
||||||
x:Name="PART_TitleBar"
|
x:Name="TitleBar"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}"
|
Padding="8,0,200,0"
|
||||||
Subtitle="Ghost Engine">
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
<TitleBar.IconSource>
|
BorderThickness="0,0,0,1"
|
||||||
<ImageIconSource ImageSource="ms-appx:///Assets/icon.targetsize-48.png" />
|
Orientation="Horizontal">
|
||||||
</TitleBar.IconSource>
|
<TextBlock
|
||||||
</TitleBar>
|
Margin="0,0,12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontFamily="Arial"
|
||||||
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
|
Text="GHOST ENGINE" />
|
||||||
|
|
||||||
<!-- Toolbar -->
|
<MenuBar>
|
||||||
<Grid
|
<MenuBarItem Title="File">
|
||||||
Grid.Row="1"
|
<MenuFlyoutItem Text="New" />
|
||||||
Padding="4,0,4,4"
|
<MenuFlyoutItem Text="Open..." />
|
||||||
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}">
|
<MenuFlyoutItem Text="Save" />
|
||||||
<ctc:TabbedCommandBar>
|
<MenuFlyoutItem Text="Exit" />
|
||||||
<ctc:TabbedCommandBar.MenuItems>
|
</MenuBarItem>
|
||||||
<ctc:TabbedCommandBarItem Header="Home">
|
|
||||||
<AppBarButton Label="Undo" />
|
|
||||||
<AppBarButton Label="Redo" />
|
|
||||||
<AppBarButton Label="Paste" />
|
|
||||||
</ctc:TabbedCommandBarItem>
|
|
||||||
<ctc:TabbedCommandBarItem Header="Home">
|
|
||||||
<AppBarButton Label="Undo" />
|
|
||||||
<AppBarButton Label="Redo" />
|
|
||||||
<AppBarButton Label="Paste" />
|
|
||||||
</ctc:TabbedCommandBarItem>
|
|
||||||
<ctc:TabbedCommandBarItem Header="Home">
|
|
||||||
<AppBarButton Label="Undo" />
|
|
||||||
<AppBarButton Label="Redo" />
|
|
||||||
<AppBarButton Label="Paste" />
|
|
||||||
</ctc:TabbedCommandBarItem>
|
|
||||||
</ctc:TabbedCommandBar.MenuItems>
|
|
||||||
</ctc:TabbedCommandBar>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Grid xmlns:dock="using:Ghost.Editor.Views.Controls.Docking" Grid.Row="2">
|
<MenuBarItem Title="Edit">
|
||||||
<dock:DockingLayout x:Name="MainDockingLayout" />
|
<MenuFlyoutItem Text="Undo" />
|
||||||
</Grid>
|
<MenuFlyoutItem Text="Cut" />
|
||||||
|
<MenuFlyoutItem Text="Copy" />
|
||||||
|
<MenuFlyoutItem Text="Paste" />
|
||||||
|
</MenuBarItem>
|
||||||
|
|
||||||
<!-- Editor -->
|
<MenuBarItem Title="Help">
|
||||||
<!--<Grid Grid.Row="2">
|
<MenuFlyoutItem Text="About" />
|
||||||
|
</MenuBarItem>
|
||||||
|
</MenuBar>
|
||||||
|
|
||||||
|
<Border Height="12" Style="{StaticResource VerticalDivider}" />
|
||||||
|
|
||||||
|
<SelectorBar>
|
||||||
|
<SelectorBarItem Text="Edit" />
|
||||||
|
<SelectorBarItem Text="Analysis" />
|
||||||
|
<SelectorBarItem Text="Build" />
|
||||||
|
</SelectorBar>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!--<Frame
|
||||||
|
x:Name="ContentFrame"
|
||||||
|
Grid.Row="2"
|
||||||
|
IsNavigationStackEnabled="False" />-->
|
||||||
|
<Grid Grid.Row="1" Background="{ThemeResource LayerFillColorDefaultBrush}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Row="0">
|
<!-- Toolbar -->
|
||||||
|
<StackPanel
|
||||||
|
Grid.Row="0"
|
||||||
|
Padding="8,0"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<ComboBox
|
||||||
|
Width="200"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
SelectedIndex="0">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||||
|
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||||
|
<TextBlock Text="Selection Mode" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||||
|
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||||
|
<TextBlock Text="Placement Mode" />
|
||||||
|
</StackPanel>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<Border Height="12" Style="{StaticResource VerticalDivider}" />
|
||||||
|
|
||||||
|
<MenuBar>
|
||||||
|
<MenuBarItem Title="File">
|
||||||
|
<MenuFlyoutItem Text="New" />
|
||||||
|
<MenuFlyoutItem Text="Open..." />
|
||||||
|
<MenuFlyoutItem Text="Save" />
|
||||||
|
<MenuFlyoutItem Text="Exit" />
|
||||||
|
</MenuBarItem>
|
||||||
|
|
||||||
|
<MenuBarItem Title="Edit">
|
||||||
|
<MenuFlyoutItem Text="Undo" />
|
||||||
|
<MenuFlyoutItem Text="Cut" />
|
||||||
|
<MenuFlyoutItem Text="Copy" />
|
||||||
|
<MenuFlyoutItem Text="Paste" />
|
||||||
|
</MenuBarItem>
|
||||||
|
|
||||||
|
<MenuBarItem Title="Help">
|
||||||
|
<MenuFlyoutItem Text="About" />
|
||||||
|
</MenuBarItem>
|
||||||
|
</MenuBar>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
Grid.Row="1"
|
||||||
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="0,1,0,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="0.25*" MaxWidth="350" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="0.25*" MaxWidth="350" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<ghost:NavigationTabView
|
<!-- Hierarchy -->
|
||||||
|
<Grid
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Width="350"
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
HorizontalAlignment="Stretch"
|
BorderThickness="0,0,1,0">
|
||||||
VerticalAlignment="Stretch">
|
<Grid.RowDefinitions>
|
||||||
<ghost:NavigationTabView.TabItems>
|
<RowDefinition Height="Auto" />
|
||||||
<TabViewItem Header="Hierarchy">
|
<RowDefinition Height="*" />
|
||||||
<TabViewItem.IconSource>
|
</Grid.RowDefinitions>
|
||||||
<FontIconSource Glyph="" />
|
|
||||||
</TabViewItem.IconSource>
|
|
||||||
<controls:Hierarchy />
|
|
||||||
</TabViewItem>
|
|
||||||
</ghost:NavigationTabView.TabItems>
|
|
||||||
</ghost:NavigationTabView>
|
|
||||||
|
|
||||||
<ghost:NavigationTabView Grid.Column="1">
|
<StackPanel
|
||||||
<ghost:NavigationTabView.TabItems>
|
Grid.Row="0"
|
||||||
<ee:ScenePage Header="Scene">
|
Padding="8,2,4,4"
|
||||||
<ee:ScenePage.IconSource>
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}">
|
||||||
<FontIconSource Glyph="" />
|
<Grid>
|
||||||
</ee:ScenePage.IconSource>
|
<Grid.ColumnDefinitions>
|
||||||
</ee:ScenePage>
|
<ColumnDefinition Width="*" />
|
||||||
</ghost:NavigationTabView.TabItems>
|
<ColumnDefinition Width="Auto" />
|
||||||
</ghost:NavigationTabView>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<ghost:NavigationTabView
|
<TextBlock
|
||||||
|
Grid.Column="0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
|
||||||
|
Style="{StaticResource BodyLargeStrongTextBlockStyle}"
|
||||||
|
Text="Hierarchy" />
|
||||||
|
<Button
|
||||||
|
Grid.Column="1"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Style="{ThemeResource ToolbarButton}">
|
||||||
|
<FontIcon Glyph="" />
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid Margin="0,2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="0,0,4,0"
|
||||||
|
FontSize="{StaticResource ToolbarFontIconFontSize}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBox Grid.Column="1" PlaceholderText="Sreach item..." />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Border Margin="-8,8,-4,-4" Style="{StaticResource HorizontalDivider}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<ListView Grid.Row="1" Padding="4,2,0,2">
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
</ListView>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Scene and Content -->
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="0.3*" MaxHeight="350" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- Scene Toolbar -->
|
||||||
|
<StackPanel
|
||||||
|
Padding="2"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="0,0,0,1"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<Button Style="{ThemeResource ToolbarButton}">
|
||||||
|
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||||
|
</Button>
|
||||||
|
<Button Style="{ThemeResource ToolbarButton}">
|
||||||
|
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||||
|
</Button>
|
||||||
|
<Button Style="{ThemeResource ToolbarButton}">
|
||||||
|
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Scene -->
|
||||||
|
<Image
|
||||||
|
Grid.Row="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Source="C:/Users/Misaki/OneDrive/Pictures/Screenshots/Screenshot 2023-11-28 000914.png"
|
||||||
|
Stretch="UniformToFill" />
|
||||||
|
|
||||||
|
<!-- Content Brower -->
|
||||||
|
<Border
|
||||||
|
Grid.Row="2"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="0,1,0,1">
|
||||||
|
<SelectorBar>
|
||||||
|
<SelectorBarItem Text="Project" />
|
||||||
|
<SelectorBarItem Text="Console" />
|
||||||
|
<SelectorBarItem Text="Log" />
|
||||||
|
</SelectorBar>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!--<Frame Name="ContentBrowerFrame" Grid.Row="3" />-->
|
||||||
|
<Grid Grid.Row="3">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.15*" MaxWidth="250" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Border
|
||||||
|
Grid.Column="0"
|
||||||
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="0,0,1,0">
|
||||||
|
<ListView>
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
<ListViewItem Content="Test" />
|
||||||
|
</ListView>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
Grid.Row="0"
|
||||||
|
Padding="8,4"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="0,0,0,1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
Grid.Column="2"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="4">
|
||||||
|
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||||
|
<AutoSuggestBox Width="300" PlaceholderText="Search asset..." />
|
||||||
|
<DropDownButton Padding="2" Style="{ThemeResource ToolbarButton}">
|
||||||
|
<DropDownButton.Flyout>
|
||||||
|
<MenuFlyout Placement="Bottom">
|
||||||
|
<MenuFlyoutItem Text="Send" />
|
||||||
|
<MenuFlyoutItem Text="Reply" />
|
||||||
|
<MenuFlyoutItem Text="Reply All" />
|
||||||
|
</MenuFlyout>
|
||||||
|
</DropDownButton.Flyout>
|
||||||
|
<FontIcon FontSize="12" Glyph="" />
|
||||||
|
</DropDownButton>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Inspector -->
|
||||||
|
<Grid
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Width="350"
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
HorizontalAlignment="Stretch"
|
BorderThickness="1,0,0,0">
|
||||||
VerticalAlignment="Stretch">
|
<Grid.RowDefinitions>
|
||||||
<ghost:NavigationTabView.TabItems>
|
<RowDefinition Height="Auto" />
|
||||||
<ee:InspectorPage Header="Inspector">
|
<RowDefinition Height="*" />
|
||||||
<ee:InspectorPage.IconSource>
|
</Grid.RowDefinitions>
|
||||||
<FontIconSource Glyph="" />
|
|
||||||
</ee:InspectorPage.IconSource>
|
|
||||||
</ee:InspectorPage>
|
|
||||||
</ghost:NavigationTabView.TabItems>
|
|
||||||
</ghost:NavigationTabView>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<ghost:NavigationTabView Grid.Row="1" Height="350">
|
<!-- Inspector Header -->
|
||||||
<ghost:NavigationTabView.TabItems>
|
<Grid
|
||||||
<TabViewItem Header="Project">
|
Grid.Row="0"
|
||||||
<TabViewItem.IconSource>
|
Padding="12,12,8,12"
|
||||||
<FontIconSource Glyph="" />
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
</TabViewItem.IconSource>
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
<controls:ProjectBrowser />
|
BorderThickness="0,0,0,1"
|
||||||
</TabViewItem>
|
ColumnSpacing="8">
|
||||||
<TabViewItem Header="Console">
|
<Grid.ColumnDefinitions>
|
||||||
<TabViewItem.IconSource>
|
<ColumnDefinition Width="Auto" />
|
||||||
<FontIconSource Glyph="" />
|
<ColumnDefinition Width="*" />
|
||||||
</TabViewItem.IconSource>
|
<ColumnDefinition Width="Auto" />
|
||||||
<ee:ConsolePage />
|
</Grid.ColumnDefinitions>
|
||||||
</TabViewItem>
|
|
||||||
</ghost:NavigationTabView.TabItems>
|
<FontIcon
|
||||||
</ghost:NavigationTabView>
|
Grid.Column="0"
|
||||||
</Grid>-->
|
FontSize="18"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBox
|
||||||
|
Grid.Column="1"
|
||||||
|
FontSize="14"
|
||||||
|
Text="Name" />
|
||||||
|
<DropDownButton
|
||||||
|
Grid.Column="2"
|
||||||
|
Padding="2"
|
||||||
|
Style="{ThemeResource ToolbarButton}">
|
||||||
|
<DropDownButton.Flyout>
|
||||||
|
<MenuFlyout Placement="Bottom">
|
||||||
|
<MenuFlyoutItem Text="Send" />
|
||||||
|
<MenuFlyoutItem Text="Reply" />
|
||||||
|
<MenuFlyoutItem Text="Reply All" />
|
||||||
|
</MenuFlyout>
|
||||||
|
</DropDownButton.Flyout>
|
||||||
|
<FontIcon FontSize="12" Glyph="" />
|
||||||
|
</DropDownButton>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Content -->
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" MaxHeight="150" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid Grid.Row="0" Padding="8,2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource BodyStrongTextBlockStyle}"
|
||||||
|
Text="Components" />
|
||||||
|
<Button Grid.Column="1" Style="{ThemeResource ToolbarButton}">
|
||||||
|
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||||
|
</Button>
|
||||||
|
<Button Grid.Column="2" Style="{ThemeResource ToolbarButton}">
|
||||||
|
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<AutoSuggestBox
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="8,0"
|
||||||
|
PlaceholderText="Search components..." />
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
Grid.Row="2"
|
||||||
|
Padding="4,2,0,2"
|
||||||
|
SelectionMode="Extended">
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
<TextBlock Text="Test" />
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
Grid.Row="3"
|
||||||
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="0,1,0,0">
|
||||||
|
<ItemsRepeater />
|
||||||
|
</ScrollView>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<!-- Status Bar -->
|
<!-- Status Bar -->
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="3"
|
Grid.Row="2"
|
||||||
Height="25"
|
Padding="8,4"
|
||||||
Background="{ThemeResource SmokeFillColorDefaultBrush}">
|
Background="{ThemeResource SolidBackgroundFillColorSecondaryBrush}"
|
||||||
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="0,1,0,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Column="0">
|
<Grid.Resources>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
|
||||||
|
<Setter Property="FontSize" Value="12" />
|
||||||
|
</Style>
|
||||||
|
</Grid.Resources>
|
||||||
|
|
||||||
|
<TextBlock Grid.Column="0" Text="Ghost Engine v1.0.0 - Test" />
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
Grid.Column="2"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="4">
|
||||||
|
<FontIcon FontSize="16" Glyph="" />
|
||||||
|
<TextBlock Margin="0,0,12,0" Text="Mem: 4.0 GB" />
|
||||||
|
|
||||||
<FontIcon
|
<FontIcon
|
||||||
Margin="8,0,0,0"
|
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
Foreground="{ThemeResource SystemFillColorSuccessBrush}"
|
Foreground="{ThemeResource SystemFillColorSuccessBrush}"
|
||||||
Glyph=""
|
Glyph=""
|
||||||
Visibility="Visible" />
|
Visibility="Visible" />
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" Visibility="Collapsed">
|
<StackPanel
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="4"
|
||||||
|
Visibility="Collapsed">
|
||||||
<FontIcon
|
<FontIcon
|
||||||
Margin="8,0,0,0"
|
Margin="4,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
Foreground="{ThemeResource SystemFillColorAttentionBrush}"
|
Foreground="{ThemeResource SystemFillColorAttentionBrush}"
|
||||||
Glyph="" />
|
Glyph="" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="4,0,0,0"
|
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="0" />
|
Text="0" />
|
||||||
<FontIcon
|
<FontIcon
|
||||||
Margin="8,0,0,0"
|
Margin="4,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
Foreground="{ThemeResource SystemFillColorCautionBrush}"
|
Foreground="{ThemeResource SystemFillColorCautionBrush}"
|
||||||
Glyph="" />
|
Glyph="" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="4,0,0,0"
|
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="0" />
|
Text="0" />
|
||||||
<FontIcon
|
<FontIcon
|
||||||
Margin="8,0,0,0"
|
Margin="4,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
|
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
|
||||||
Glyph="" />
|
Glyph="" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="4,0,0,0"
|
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="0" />
|
Text="0" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</StackPanel>
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Info and Progress -->
|
|
||||||
<Grid Grid.Row="0" Grid.RowSpan="4">
|
|
||||||
<InfoBar
|
|
||||||
x:Name="InfoBar"
|
|
||||||
Margin="16"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Bottom">
|
|
||||||
<interactivity:Interaction.Behaviors>
|
|
||||||
<behaviors:StackedNotificationsBehavior x:Name="NotificationQueue" />
|
|
||||||
</interactivity:Interaction.Behaviors>
|
|
||||||
</InfoBar>
|
|
||||||
|
|
||||||
<Grid
|
|
||||||
x:Name="ProgressBarContainer"
|
|
||||||
Background="{ThemeResource SmokeFillColorDefaultBrush}"
|
|
||||||
Visibility="Collapsed">
|
|
||||||
<Grid
|
|
||||||
Height="100"
|
|
||||||
Padding="36,24"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Background="{ThemeResource SolidBackgroundFillColorBaseBrush}"
|
|
||||||
CornerRadius="{StaticResource OverlayCornerRadius}">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
x:Name="ProgressMessage"
|
|
||||||
Grid.Row="0"
|
|
||||||
Margin="0,0,0,12"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{StaticResource TitleTextBlockStyle}"
|
|
||||||
Text="Loading..." />
|
|
||||||
<ProgressBar
|
|
||||||
x:Name="ProgressBar"
|
|
||||||
Grid.Row="1"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
IsIndeterminate="True" />
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</winex:WindowEx>
|
</winex:WindowEx>
|
||||||
|
|||||||
@@ -1,88 +1,17 @@
|
|||||||
using Ghost.Editor.Core;
|
|
||||||
using Ghost.Editor.Core.Contracts;
|
|
||||||
using Ghost.Editor.Core.Services;
|
|
||||||
using Ghost.Editor.ViewModels.Windows;
|
|
||||||
using Windows.ApplicationModel;
|
|
||||||
using WinUIEx;
|
using WinUIEx;
|
||||||
|
|
||||||
namespace Ghost.Editor.Views.Windows;
|
namespace Ghost.Editor.Views.Windows;
|
||||||
/// <summary>
|
|
||||||
/// An empty window that can be used on its own or navigated to within a Frame.
|
|
||||||
/// </summary>
|
|
||||||
internal sealed partial class EngineEditorWindow : WindowEx
|
internal sealed partial class EngineEditorWindow : WindowEx
|
||||||
{
|
{
|
||||||
private readonly NotificationService _notificationService;
|
|
||||||
private readonly ProgressService _progressService;
|
|
||||||
|
|
||||||
public EngineEditorViewModel ViewModel
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EngineEditorWindow()
|
public EngineEditorWindow()
|
||||||
{
|
{
|
||||||
ViewModel = App.GetService<EngineEditorViewModel>();
|
|
||||||
|
|
||||||
_notificationService = (NotificationService)App.GetService<INotificationService>();
|
|
||||||
_progressService = (ProgressService)App.GetService<IProgressService>();
|
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/icon.ico"));
|
AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/icon.ico"));
|
||||||
Title = "Ghost Engine";
|
|
||||||
ExtendsContentIntoTitleBar = true;
|
ExtendsContentIntoTitleBar = true;
|
||||||
|
Title = "Ghost Engine";
|
||||||
|
|
||||||
SetTitleBar(PART_TitleBar);
|
SetTitleBar(TitleBar);
|
||||||
this.CenterOnScreen();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private void MainGrid_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
PART_TitleBar.Title = EditorApplication.ProjectName;
|
|
||||||
PART_TitleBar.Subtitle = $"Ghost Engine {Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}";
|
|
||||||
|
|
||||||
_notificationService.SetReference(InfoBar, NotificationQueue);
|
|
||||||
_progressService.SetReference(ProgressBarContainer);
|
|
||||||
|
|
||||||
InitializeDockingLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InitializeDockingLayout()
|
|
||||||
{
|
|
||||||
var sceneDoc = new Controls.Docking.DockDocument { Title = "Scene", Content = new Pages.EngineEditor.ScenePage() };
|
|
||||||
var hierarchyDoc = new Controls.Docking.DockDocument { Title = "Hierarchy", Content = new Controls.Hierarchy() };
|
|
||||||
var inspectorDoc = new Controls.Docking.DockDocument { Title = "Inspector", Content = new Pages.EngineEditor.InspectorPage() };
|
|
||||||
var projectDoc = new Controls.Docking.DockDocument { Title = "Project", Content = new Controls.ProjectBrowser() };
|
|
||||||
var consoleDoc = new Controls.Docking.DockDocument { Title = "Console", Content = new Pages.EngineEditor.ConsolePage() };
|
|
||||||
|
|
||||||
var leftGroup = new Controls.Docking.DockGroup();
|
|
||||||
leftGroup.AddChild(hierarchyDoc);
|
|
||||||
|
|
||||||
var centerGroup = new Controls.Docking.DockGroup();
|
|
||||||
centerGroup.AddChild(sceneDoc);
|
|
||||||
|
|
||||||
var rightGroup = new Controls.Docking.DockGroup();
|
|
||||||
rightGroup.AddChild(inspectorDoc);
|
|
||||||
|
|
||||||
var bottomGroup = new Controls.Docking.DockGroup();
|
|
||||||
bottomGroup.AddChild(projectDoc);
|
|
||||||
bottomGroup.AddChild(consoleDoc);
|
|
||||||
|
|
||||||
var topPanel = new Controls.Docking.DockPanel { Orientation = Microsoft.UI.Xaml.Controls.Orientation.Horizontal };
|
|
||||||
topPanel.AddChild(leftGroup);
|
|
||||||
topPanel.AddChild(centerGroup);
|
|
||||||
topPanel.AddChild(rightGroup);
|
|
||||||
|
|
||||||
var rootPanel = new Controls.Docking.DockPanel { Orientation = Microsoft.UI.Xaml.Controls.Orientation.Vertical };
|
|
||||||
rootPanel.AddChild(topPanel);
|
|
||||||
rootPanel.AddChild(bottomGroup);
|
|
||||||
|
|
||||||
MainDockingLayout.RootModule = rootPanel;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MainGrid_Unloaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
_notificationService.ClearReference();
|
|
||||||
_progressService.ClearReference();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
246
src/Editor/Ghost.Editor/Views/Windows/EngineEditorWindowOld.xaml
Normal file
246
src/Editor/Ghost.Editor/Views/Windows/EngineEditorWindowOld.xaml
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<winex:WindowEx
|
||||||
|
x:Class="Ghost.Editor.Views.Windows.EngineEditorWindowOld"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors"
|
||||||
|
xmlns:controls="using:Ghost.Editor.Views.Controls"
|
||||||
|
xmlns:ctc="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:ee="using:Ghost.Editor.Views.Pages.EngineEditor"
|
||||||
|
xmlns:ghost="using:Ghost.Editor.Controls"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:Ghost.Editor.Views.Windows"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:winex="using:WinUIEx"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Window.SystemBackdrop>
|
||||||
|
<MicaBackdrop />
|
||||||
|
</Window.SystemBackdrop>
|
||||||
|
|
||||||
|
<Grid Loaded="MainGrid_Loaded" Unloaded="MainGrid_Unloaded">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- Titlebar -->
|
||||||
|
<TitleBar
|
||||||
|
x:Name="PART_TitleBar"
|
||||||
|
Grid.Row="0"
|
||||||
|
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}"
|
||||||
|
Subtitle="Ghost Engine">
|
||||||
|
<TitleBar.IconSource>
|
||||||
|
<ImageIconSource ImageSource="ms-appx:///Assets/icon.targetsize-48.png" />
|
||||||
|
</TitleBar.IconSource>
|
||||||
|
</TitleBar>
|
||||||
|
|
||||||
|
<!-- Toolbar -->
|
||||||
|
<Grid
|
||||||
|
Grid.Row="1"
|
||||||
|
Padding="4,0,4,4"
|
||||||
|
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}">
|
||||||
|
<ctc:TabbedCommandBar>
|
||||||
|
<ctc:TabbedCommandBar.MenuItems>
|
||||||
|
<ctc:TabbedCommandBarItem Header="Home">
|
||||||
|
<AppBarButton Label="Undo" />
|
||||||
|
<AppBarButton Label="Redo" />
|
||||||
|
<AppBarButton Label="Paste" />
|
||||||
|
</ctc:TabbedCommandBarItem>
|
||||||
|
<ctc:TabbedCommandBarItem Header="Home">
|
||||||
|
<AppBarButton Label="Undo" />
|
||||||
|
<AppBarButton Label="Redo" />
|
||||||
|
<AppBarButton Label="Paste" />
|
||||||
|
</ctc:TabbedCommandBarItem>
|
||||||
|
<ctc:TabbedCommandBarItem Header="Home">
|
||||||
|
<AppBarButton Label="Undo" />
|
||||||
|
<AppBarButton Label="Redo" />
|
||||||
|
<AppBarButton Label="Paste" />
|
||||||
|
</ctc:TabbedCommandBarItem>
|
||||||
|
</ctc:TabbedCommandBar.MenuItems>
|
||||||
|
</ctc:TabbedCommandBar>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid xmlns:dock="using:Ghost.Editor.Views.Controls.Docking" Grid.Row="2">
|
||||||
|
<dock:DockingLayout x:Name="MainDockingLayout" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Editor -->
|
||||||
|
<!--<Grid Grid.Row="2">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid Grid.Row="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<ghost:NavigationTabView
|
||||||
|
Grid.Column="0"
|
||||||
|
Width="350"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch">
|
||||||
|
<ghost:NavigationTabView.TabItems>
|
||||||
|
<TabViewItem Header="Hierarchy">
|
||||||
|
<TabViewItem.IconSource>
|
||||||
|
<FontIconSource Glyph="" />
|
||||||
|
</TabViewItem.IconSource>
|
||||||
|
<controls:Hierarchy />
|
||||||
|
</TabViewItem>
|
||||||
|
</ghost:NavigationTabView.TabItems>
|
||||||
|
</ghost:NavigationTabView>
|
||||||
|
|
||||||
|
<ghost:NavigationTabView Grid.Column="1">
|
||||||
|
<ghost:NavigationTabView.TabItems>
|
||||||
|
<ee:ScenePage Header="Scene">
|
||||||
|
<ee:ScenePage.IconSource>
|
||||||
|
<FontIconSource Glyph="" />
|
||||||
|
</ee:ScenePage.IconSource>
|
||||||
|
</ee:ScenePage>
|
||||||
|
</ghost:NavigationTabView.TabItems>
|
||||||
|
</ghost:NavigationTabView>
|
||||||
|
|
||||||
|
<ghost:NavigationTabView
|
||||||
|
Grid.Column="2"
|
||||||
|
Width="350"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch">
|
||||||
|
<ghost:NavigationTabView.TabItems>
|
||||||
|
<ee:InspectorPage Header="Inspector">
|
||||||
|
<ee:InspectorPage.IconSource>
|
||||||
|
<FontIconSource Glyph="" />
|
||||||
|
</ee:InspectorPage.IconSource>
|
||||||
|
</ee:InspectorPage>
|
||||||
|
</ghost:NavigationTabView.TabItems>
|
||||||
|
</ghost:NavigationTabView>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<ghost:NavigationTabView Grid.Row="1" Height="350">
|
||||||
|
<ghost:NavigationTabView.TabItems>
|
||||||
|
<TabViewItem Header="Project">
|
||||||
|
<TabViewItem.IconSource>
|
||||||
|
<FontIconSource Glyph="" />
|
||||||
|
</TabViewItem.IconSource>
|
||||||
|
<controls:ProjectBrowser />
|
||||||
|
</TabViewItem>
|
||||||
|
<TabViewItem Header="Console">
|
||||||
|
<TabViewItem.IconSource>
|
||||||
|
<FontIconSource Glyph="" />
|
||||||
|
</TabViewItem.IconSource>
|
||||||
|
<ee:ConsolePage />
|
||||||
|
</TabViewItem>
|
||||||
|
</ghost:NavigationTabView.TabItems>
|
||||||
|
</ghost:NavigationTabView>
|
||||||
|
</Grid>-->
|
||||||
|
|
||||||
|
<!-- Status Bar -->
|
||||||
|
<Grid
|
||||||
|
Grid.Row="3"
|
||||||
|
Height="25"
|
||||||
|
Background="{ThemeResource SmokeFillColorDefaultBrush}">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Grid Grid.Column="0">
|
||||||
|
<FontIcon
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource SystemFillColorSuccessBrush}"
|
||||||
|
Glyph=""
|
||||||
|
Visibility="Visible" />
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal" Visibility="Collapsed">
|
||||||
|
<FontIcon
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource SystemFillColorAttentionBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="0" />
|
||||||
|
<FontIcon
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource SystemFillColorCautionBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="0" />
|
||||||
|
<FontIcon
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="0" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Info and Progress -->
|
||||||
|
<Grid Grid.Row="0" Grid.RowSpan="4">
|
||||||
|
<InfoBar
|
||||||
|
x:Name="InfoBar"
|
||||||
|
Margin="16"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Bottom">
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<behaviors:StackedNotificationsBehavior x:Name="NotificationQueue" />
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
</InfoBar>
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
x:Name="ProgressBarContainer"
|
||||||
|
Background="{ThemeResource SmokeFillColorDefaultBrush}"
|
||||||
|
Visibility="Collapsed">
|
||||||
|
<Grid
|
||||||
|
Height="100"
|
||||||
|
Padding="36,24"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Background="{ThemeResource SolidBackgroundFillColorBaseBrush}"
|
||||||
|
CornerRadius="{StaticResource OverlayCornerRadius}">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
x:Name="ProgressMessage"
|
||||||
|
Grid.Row="0"
|
||||||
|
Margin="0,0,0,12"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource TitleTextBlockStyle}"
|
||||||
|
Text="Loading..." />
|
||||||
|
<ProgressBar
|
||||||
|
x:Name="ProgressBar"
|
||||||
|
Grid.Row="1"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
IsIndeterminate="True" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</winex:WindowEx>
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
using Ghost.Editor.Core;
|
||||||
|
using Ghost.Editor.Core.Contracts;
|
||||||
|
using Ghost.Editor.Core.Services;
|
||||||
|
using Ghost.Editor.ViewModels.Windows;
|
||||||
|
using Windows.ApplicationModel;
|
||||||
|
using WinUIEx;
|
||||||
|
|
||||||
|
namespace Ghost.Editor.Views.Windows;
|
||||||
|
/// <summary>
|
||||||
|
/// An empty window that can be used on its own or navigated to within a Frame.
|
||||||
|
/// </summary>
|
||||||
|
internal sealed partial class EngineEditorWindowOld : WindowEx
|
||||||
|
{
|
||||||
|
private readonly NotificationService _notificationService;
|
||||||
|
private readonly ProgressService _progressService;
|
||||||
|
|
||||||
|
public EngineEditorViewModel ViewModel
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EngineEditorWindowOld()
|
||||||
|
{
|
||||||
|
ViewModel = App.GetService<EngineEditorViewModel>();
|
||||||
|
|
||||||
|
_notificationService = (NotificationService)App.GetService<INotificationService>();
|
||||||
|
_progressService = (ProgressService)App.GetService<IProgressService>();
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/icon.ico"));
|
||||||
|
Title = "Ghost Engine";
|
||||||
|
ExtendsContentIntoTitleBar = true;
|
||||||
|
|
||||||
|
SetTitleBar(PART_TitleBar);
|
||||||
|
this.CenterOnScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainGrid_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
PART_TitleBar.Title = EditorApplication.ProjectName;
|
||||||
|
PART_TitleBar.Subtitle = $"Ghost Engine {Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}";
|
||||||
|
|
||||||
|
_notificationService.SetReference(InfoBar, NotificationQueue);
|
||||||
|
_progressService.SetReference(ProgressBarContainer);
|
||||||
|
|
||||||
|
InitializeDockingLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeDockingLayout()
|
||||||
|
{
|
||||||
|
var sceneDoc = new Controls.Docking.DockDocument { Title = "Scene", Content = new Pages.EngineEditor.ScenePage() };
|
||||||
|
var hierarchyDoc = new Controls.Docking.DockDocument { Title = "Hierarchy", Content = new Controls.Hierarchy() };
|
||||||
|
var inspectorDoc = new Controls.Docking.DockDocument { Title = "Inspector", Content = new Pages.EngineEditor.InspectorPage() };
|
||||||
|
var projectDoc = new Controls.Docking.DockDocument { Title = "Project", Content = new Controls.ProjectBrowser() };
|
||||||
|
var consoleDoc = new Controls.Docking.DockDocument { Title = "Console", Content = new Pages.EngineEditor.ConsolePage() };
|
||||||
|
|
||||||
|
var leftGroup = new Controls.Docking.DockGroup();
|
||||||
|
leftGroup.AddChild(hierarchyDoc);
|
||||||
|
|
||||||
|
var centerGroup = new Controls.Docking.DockGroup();
|
||||||
|
centerGroup.AddChild(sceneDoc);
|
||||||
|
|
||||||
|
var rightGroup = new Controls.Docking.DockGroup();
|
||||||
|
rightGroup.AddChild(inspectorDoc);
|
||||||
|
|
||||||
|
var bottomGroup = new Controls.Docking.DockGroup();
|
||||||
|
bottomGroup.AddChild(projectDoc);
|
||||||
|
bottomGroup.AddChild(consoleDoc);
|
||||||
|
|
||||||
|
var topPanel = new Controls.Docking.DockPanel { Orientation = Microsoft.UI.Xaml.Controls.Orientation.Horizontal };
|
||||||
|
topPanel.AddChild(leftGroup);
|
||||||
|
topPanel.AddChild(centerGroup);
|
||||||
|
topPanel.AddChild(rightGroup);
|
||||||
|
|
||||||
|
var rootPanel = new Controls.Docking.DockPanel { Orientation = Microsoft.UI.Xaml.Controls.Orientation.Vertical };
|
||||||
|
rootPanel.AddChild(topPanel);
|
||||||
|
rootPanel.AddChild(bottomGroup);
|
||||||
|
|
||||||
|
MainDockingLayout.RootModule = rootPanel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainGrid_Unloaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_notificationService.ClearReference();
|
||||||
|
_progressService.ClearReference();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,7 +22,7 @@ internal partial class GhostRenderPipeline : IRenderPipeline
|
|||||||
_gpuScene = new GPUScene(renderSystem.GraphicsEngine.ResourceAllocator, renderSystem.GraphicsEngine.ResourceDatabase, 102_400u); // 102.4k objects should be enough for now
|
_gpuScene = new GPUScene(renderSystem.GraphicsEngine.ResourceAllocator, renderSystem.GraphicsEngine.ResourceDatabase, 102_400u); // 102.4k objects should be enough for now
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Render(RenderContext ctx, int frameIndex, IRenderPayload payload, ReadOnlySpan<byte> resourceUpdateCommands)
|
public void Render(RenderContext ctx, int frameIndex, IRenderPayload payload)
|
||||||
{
|
{
|
||||||
var ghostPayload = (GhostRenderPayload)payload;
|
var ghostPayload = (GhostRenderPayload)payload;
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Editor\Ghost.Editor.Core\Ghost.Editor.Core.csproj" />
|
<ProjectReference Include="..\..\Editor\Ghost.Editor.Core\Ghost.Editor.Core.csproj" />
|
||||||
|
<ProjectReference Include="..\..\Runtime\Ghost.Engine\Ghost.Engine.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user