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:
2026-04-20 16:54:49 +09:00
parent ed00f205b0
commit c249a389e3
17 changed files with 806 additions and 375 deletions

View File

@@ -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>

View File

@@ -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();
}
}

View File

@@ -3,244 +3,491 @@
x:Class="Ghost.Editor.Views.Windows.EngineEditorWindow"
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"
Title="EditorWindow"
mc:Ignorable="d">
<Window.SystemBackdrop>
<winex:WindowEx.SystemBackdrop>
<MicaBackdrop />
</Window.SystemBackdrop>
</winex:WindowEx.SystemBackdrop>
<Grid Loaded="MainGrid_Loaded" Unloaded="MainGrid_Unloaded">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Titlebar -->
<TitleBar
x:Name="PART_TitleBar"
<!-- Title Bar -->
<StackPanel
x:Name="TitleBar"
Grid.Row="0"
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}"
Subtitle="Ghost Engine">
<TitleBar.IconSource>
<ImageIconSource ImageSource="ms-appx:///Assets/icon.targetsize-48.png" />
</TitleBar.IconSource>
</TitleBar>
Padding="8,0,200,0"
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="0,0,0,1"
Orientation="Horizontal">
<TextBlock
Margin="0,0,12,0"
VerticalAlignment="Center"
FontFamily="Arial"
Style="{StaticResource SubtitleTextBlockStyle}"
Text="GHOST ENGINE" />
<!-- 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>
<MenuBar>
<MenuBarItem Title="File">
<MenuFlyoutItem Text="New" />
<MenuFlyoutItem Text="Open..." />
<MenuFlyoutItem Text="Save" />
<MenuFlyoutItem Text="Exit" />
</MenuBarItem>
<Grid xmlns:dock="using:Ghost.Editor.Views.Controls.Docking" Grid.Row="2">
<dock:DockingLayout x:Name="MainDockingLayout" />
</Grid>
<MenuBarItem Title="Edit">
<MenuFlyoutItem Text="Undo" />
<MenuFlyoutItem Text="Cut" />
<MenuFlyoutItem Text="Copy" />
<MenuFlyoutItem Text="Paste" />
</MenuBarItem>
<!-- Editor -->
<!--<Grid Grid.Row="2">
<MenuBarItem Title="Help">
<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>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</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="&#xE8B0;" />
<TextBlock Text="Selection Mode" />
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="4">
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xEC26;" />
<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>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="0.25*" MaxWidth="350" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="0.25*" MaxWidth="350" />
</Grid.ColumnDefinitions>
<ghost:NavigationTabView
<!-- Hierarchy -->
<Grid
Grid.Column="0"
Width="350"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<ghost:NavigationTabView.TabItems>
<TabViewItem Header="Hierarchy">
<TabViewItem.IconSource>
<FontIconSource Glyph="&#xE8A4;" />
</TabViewItem.IconSource>
<controls:Hierarchy />
</TabViewItem>
</ghost:NavigationTabView.TabItems>
</ghost:NavigationTabView>
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="0,0,1,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ghost:NavigationTabView Grid.Column="1">
<ghost:NavigationTabView.TabItems>
<ee:ScenePage Header="Scene">
<ee:ScenePage.IconSource>
<FontIconSource Glyph="&#xF159;" />
</ee:ScenePage.IconSource>
</ee:ScenePage>
</ghost:NavigationTabView.TabItems>
</ghost:NavigationTabView>
<StackPanel
Grid.Row="0"
Padding="8,2,4,4"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</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="&#xE712;" />
</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="&#xE721;" />
<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="&#xE7C2;" />
</Button>
<Button Style="{ThemeResource ToolbarButton}">
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xE7AD;" />
</Button>
<Button Style="{ThemeResource ToolbarButton}">
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xE740;" />
</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="&#xE721;" />
<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="&#xF8B0;" />
</DropDownButton>
</StackPanel>
</Grid>
</Grid>
</Grid>
</Grid>
<!-- Inspector -->
<Grid
Grid.Column="2"
Width="350"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<ghost:NavigationTabView.TabItems>
<ee:InspectorPage Header="Inspector">
<ee:InspectorPage.IconSource>
<FontIconSource Glyph="&#xEC7A;" />
</ee:InspectorPage.IconSource>
</ee:InspectorPage>
</ghost:NavigationTabView.TabItems>
</ghost:NavigationTabView>
</Grid>
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="1,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ghost:NavigationTabView Grid.Row="1" Height="350">
<ghost:NavigationTabView.TabItems>
<TabViewItem Header="Project">
<TabViewItem.IconSource>
<FontIconSource Glyph="&#xEC50;" />
</TabViewItem.IconSource>
<controls:ProjectBrowser />
</TabViewItem>
<TabViewItem Header="Console">
<TabViewItem.IconSource>
<FontIconSource Glyph="&#xE756;" />
</TabViewItem.IconSource>
<ee:ConsolePage />
</TabViewItem>
</ghost:NavigationTabView.TabItems>
</ghost:NavigationTabView>
</Grid>-->
<!-- Inspector Header -->
<Grid
Grid.Row="0"
Padding="12,12,8,12"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="0,0,0,1"
ColumnSpacing="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<FontIcon
Grid.Column="0"
FontSize="18"
Glyph="&#xF158;" />
<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="&#xF8B0;" />
</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="&#xE710;" />
</Button>
<Button Grid.Column="2" Style="{ThemeResource ToolbarButton}">
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xE738;" />
</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 -->
<Grid
Grid.Row="3"
Height="25"
Background="{ThemeResource SmokeFillColorDefaultBrush}">
Grid.Row="2"
Padding="8,4"
Background="{ThemeResource SolidBackgroundFillColorSecondaryBrush}"
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</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="&#xEEA1;" />
<TextBlock Margin="0,0,12,0" Text="Mem: 4.0 GB" />
<FontIcon
Margin="8,0,0,0"
FontSize="16"
Foreground="{ThemeResource SystemFillColorSuccessBrush}"
Glyph="&#xE930;"
Visibility="Visible" />
<StackPanel Orientation="Horizontal" Visibility="Collapsed">
<StackPanel
Orientation="Horizontal"
Spacing="4"
Visibility="Collapsed">
<FontIcon
Margin="8,0,0,0"
Margin="4,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="{ThemeResource SystemFillColorAttentionBrush}"
Glyph="&#xE946;" />
<TextBlock
Margin="4,0,0,0"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="0" />
<FontIcon
Margin="8,0,0,0"
Margin="4,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="{ThemeResource SystemFillColorCautionBrush}"
Glyph="&#xE7BA;" />
<TextBlock
Margin="4,0,0,0"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="0" />
<FontIcon
Margin="8,0,0,0"
Margin="4,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
Glyph="&#xE783;" />
<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>
</StackPanel>
</Grid>
</Grid>
</winex:WindowEx>
</winex:WindowEx>

View File

@@ -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;
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
{
private readonly NotificationService _notificationService;
private readonly ProgressService _progressService;
public EngineEditorViewModel ViewModel
{
get;
}
public EngineEditorWindow()
{
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;
Title = "Ghost Engine";
SetTitleBar(PART_TitleBar);
this.CenterOnScreen();
SetTitleBar(TitleBar);
}
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();
}
}
}

View 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="&#xE8A4;" />
</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="&#xF159;" />
</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="&#xEC7A;" />
</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="&#xEC50;" />
</TabViewItem.IconSource>
<controls:ProjectBrowser />
</TabViewItem>
<TabViewItem Header="Console">
<TabViewItem.IconSource>
<FontIconSource Glyph="&#xE756;" />
</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="&#xE930;"
Visibility="Visible" />
<StackPanel Orientation="Horizontal" Visibility="Collapsed">
<FontIcon
Margin="8,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="{ThemeResource SystemFillColorAttentionBrush}"
Glyph="&#xE946;" />
<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="&#xE7BA;" />
<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="&#xE783;" />
<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>

View File

@@ -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();
}
}