feat: Implement LogViewer control and integrate into EditPage
- Added LogViewer control to display log messages with filtering options. - Integrated LogViewer into EditPage for better log management. - Updated EngineEditorWindow to navigate to EditPage. - Enhanced Logger implementation for improved performance and stack trace capturing. - Introduced PathUtility for path normalization. - Refactored AssetManager to correct shader asset type naming. - Removed obsolete AssetHandlerRegistryTests and cleaned up related tests. - Updated ImportCoordinatorTests for streamlined asset import process.
This commit is contained in:
@@ -59,366 +59,20 @@
|
||||
|
||||
<Border Height="12" Style="{StaticResource VerticalDivider}" />
|
||||
|
||||
<SelectorBar>
|
||||
<SelectorBarItem Text="Edit" />
|
||||
<SelectorBarItem Text="Analysis" />
|
||||
<SelectorBarItem Text="Build" />
|
||||
<SelectorBar SelectionChanged="SelectorBar_SelectionChanged">
|
||||
<SelectorBarItem
|
||||
x:Name="EditSelectorItem"
|
||||
IsSelected="True"
|
||||
Text="Edit" />
|
||||
<SelectorBarItem x:Name="AnalysisSelectorItem" Text="Analysis" />
|
||||
<SelectorBarItem x:Name="BuildSelectorItem" Text="Build" />
|
||||
</SelectorBar>
|
||||
</StackPanel>
|
||||
|
||||
<!--<Frame
|
||||
<Frame
|
||||
x:Name="ContentFrame"
|
||||
Grid.Row="2"
|
||||
IsNavigationStackEnabled="False" />-->
|
||||
<!-- Edit View -->
|
||||
<Grid Grid.Row="1" Background="{ThemeResource LayerFillColorDefaultBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 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>
|
||||
<ColumnDefinition Width="0.25*" MaxWidth="350" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="0.25*" MaxWidth="350" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Hierarchy -->
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,0,1,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Padding="8,2,4,4"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<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"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="1,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 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="" />
|
||||
<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..." />
|
||||
|
||||
<!-- Components List -->
|
||||
<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>
|
||||
|
||||
<!-- Component Properties for Selected Component -->
|
||||
<ScrollView
|
||||
Grid.Row="3"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,1,0,0">
|
||||
<ItemsRepeater />
|
||||
</ScrollView>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
Grid.Row="1"
|
||||
IsNavigationStackEnabled="False" />
|
||||
|
||||
<!-- Status Bar -->
|
||||
<Grid
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
using Ghost.Editor.ViewModels.Windows;
|
||||
using Ghost.Editor.Views.Pages;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media.Animation;
|
||||
using WinUIEx;
|
||||
|
||||
namespace Ghost.Editor.Views.Windows;
|
||||
|
||||
internal sealed partial class EngineEditorWindow : WindowEx
|
||||
{
|
||||
private int _previousSelectedIndex = 0;
|
||||
|
||||
public EngineEditorViewModel ViewModel
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public EngineEditorWindow()
|
||||
{
|
||||
ViewModel = App.GetService<EngineEditorViewModel>();
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/icon.ico"));
|
||||
@@ -13,5 +26,28 @@ internal sealed partial class EngineEditorWindow : WindowEx
|
||||
Title = "Ghost Engine";
|
||||
|
||||
SetTitleBar(TitleBar);
|
||||
|
||||
ContentFrame.Navigate(typeof(EditPage));
|
||||
}
|
||||
|
||||
private void SelectorBar_SelectionChanged(SelectorBar sender, SelectorBarSelectionChangedEventArgs args)
|
||||
{
|
||||
var selectedItem = sender.SelectedItem;
|
||||
var currentSelectedIndex = sender.Items.IndexOf(selectedItem);
|
||||
if (currentSelectedIndex == _previousSelectedIndex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var pageType = currentSelectedIndex switch
|
||||
{
|
||||
0 => typeof(EditPage),
|
||||
_ => typeof(EditPage),
|
||||
};
|
||||
|
||||
var slideNavigationTransitionEffect = currentSelectedIndex - _previousSelectedIndex > 0 ? SlideNavigationTransitionEffect.FromRight : SlideNavigationTransitionEffect.FromLeft;
|
||||
|
||||
ContentFrame.Navigate(pageType, null, new SlideNavigationTransitionInfo() { Effect = slideNavigationTransitionEffect });
|
||||
_previousSelectedIndex = currentSelectedIndex;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user