forked from Misaki/GhostEngine
Update icon assets
This commit is contained in:
@@ -7,22 +7,22 @@ internal interface IAppState
|
||||
/// <summary>
|
||||
/// Called when exiting the state.
|
||||
/// </summary>
|
||||
public Task<Result> OnExitingAsync();
|
||||
public ValueTask<Result> OnExitingAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Called when entering the state, right after OnEnteringAsync.
|
||||
/// <paramref name="parameter">can be used to pass data into the state, such as a project to load.</summary>
|
||||
/// </summary>
|
||||
public Task<Result> OnEnteringAsync(object? parameter);
|
||||
public ValueTask<Result> OnEnteringAsync(object? parameter);
|
||||
|
||||
/// <summary>
|
||||
/// Called when exiting the state, specifically for pose transitions.
|
||||
/// </summary>
|
||||
public Task<Result> OnExitedAsync();
|
||||
public ValueTask<Result> OnExitedAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Called when entered the state, specifically after the state has been fully initialized and is ready for interaction.
|
||||
/// </summary>
|
||||
/// <param name="parameter">can be used to pass data into the state, such as a project to load.</param>
|
||||
public Task<Result> OnEnteredAsync(object? parameter);
|
||||
public ValueTask<Result> OnEnteredAsync(object? parameter);
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="ms-appx:///Ghost.Editor.Core/Controls/BasicInput/PropertyField.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Ghost.Editor.Core/Controls/BasicInput/Vector3Field.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Ghost.Editor.Core/Controls/BasicInput/Float3Field.xaml" />
|
||||
|
||||
<ResourceDictionary Source="ms-appx:///Ghost.Editor.Core/Controls/Internal/ComponentDataView.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Ghost.Editor.Core/Controls/Internal/NavigationTabView.xaml" />
|
||||
|
||||
@@ -5,18 +5,9 @@ namespace Ghost.Editor.Core.Inspector;
|
||||
|
||||
public interface IInspectable
|
||||
{
|
||||
public IconSource? Icon
|
||||
{
|
||||
get;
|
||||
}
|
||||
public IconSource? CreateIcon();
|
||||
|
||||
public UIElement? HeaderContent
|
||||
{
|
||||
get;
|
||||
}
|
||||
public UIElement? CreateHeader();
|
||||
|
||||
public UIElement? InspectorContent
|
||||
{
|
||||
get;
|
||||
}
|
||||
public UIElement? CreateInspector();
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using Ghost.Entities;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Ghost.Editor.Core.SceneGraph;
|
||||
|
||||
@@ -7,4 +9,37 @@ public sealed partial class EntityNode : SceneGraphNode
|
||||
private readonly Entity _entity;
|
||||
|
||||
public Entity Entity => _entity;
|
||||
|
||||
public override IconSource? CreateIcon()
|
||||
{
|
||||
return new FontIconSource
|
||||
{
|
||||
Glyph = "\uF158"
|
||||
};
|
||||
}
|
||||
|
||||
public override UIElement? CreateHeader()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override UIElement? CreateInspector()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override DataTemplate GetSceneHierarchyTemplate()
|
||||
{
|
||||
var template = @"
|
||||
<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" xmlns:sg=""using:Ghost.Editor.Core.SceneGraph"" x:Key=""EntityTemplate"" x:DataType=""sg:SceneGraphNode"">
|
||||
<TreeViewItem AutomationProperties.Name=""{x:Bind Name, Mode=OneWay}"" ItemsSource=""{x:Bind Children, Mode=OneWay}"">
|
||||
<StackPanel Margin=""10,0"" Orientation=""Horizontal"">
|
||||
<FontIcon FontSize=""14"" Glyph="""" />
|
||||
<TextBlock Margin=""5,0,0,0"" Text=""{x:Bind Name, Mode=OneWay}"" />
|
||||
</StackPanel>
|
||||
</TreeViewItem>
|
||||
</DataTemplate>";
|
||||
|
||||
return (DataTemplate)Microsoft.UI.Xaml.Markup.XamlReader.Load(template);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Ghost.Editor.Core.Inspector;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Ghost.Editor.Core.SceneGraph;
|
||||
|
||||
public abstract partial class SceneGraphNode : ObservableObject
|
||||
public abstract partial class SceneGraphNode : ObservableObject, IInspectable
|
||||
{
|
||||
[ObservableProperty]
|
||||
public partial string Name
|
||||
@@ -15,4 +18,10 @@ public abstract partial class SceneGraphNode : ObservableObject
|
||||
{
|
||||
get;
|
||||
} = new();
|
||||
|
||||
public abstract IconSource? CreateIcon();
|
||||
public abstract UIElement? CreateHeader();
|
||||
public abstract UIElement? CreateInspector();
|
||||
|
||||
public abstract DataTemplate GetSceneHierarchyTemplate();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,45 @@
|
||||
using Ghost.Editor.Core.Inspector;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Ghost.Editor.Core.SceneGraph;
|
||||
|
||||
public sealed partial class SceneNode : SceneGraphNode, IInspectable
|
||||
public sealed partial class SceneNode : SceneGraphNode
|
||||
{
|
||||
public IconSource? Icon => throw new NotImplementedException();
|
||||
public override IconSource? CreateIcon()
|
||||
{
|
||||
return new FontIconSource
|
||||
{
|
||||
Glyph = "\uF156"
|
||||
};
|
||||
}
|
||||
|
||||
public UIElement? HeaderContent => throw new NotImplementedException();
|
||||
// TODO: Implement custom header and inspector UI for the SceneNode
|
||||
public override UIElement? CreateHeader()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public UIElement? InspectorContent => throw new NotImplementedException();
|
||||
}
|
||||
public override UIElement? CreateInspector()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override DataTemplate GetSceneHierarchyTemplate()
|
||||
{
|
||||
var template = @"
|
||||
<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" xmlns:sg=""using:Ghost.Editor.Core.SceneGraph"" x:DataType=""sg:SceneGraphNode"">
|
||||
<TreeViewItem
|
||||
AutomationProperties.Name=""{x:Bind Name, Mode=OneWay}""
|
||||
Background=""{ThemeResource ControlSolidFillColorDefaultBrush}""
|
||||
IsExpanded=""True""
|
||||
ItemsSource=""{ x:Bind Children, Mode=OneWay}"" >
|
||||
<StackPanel Orientation=""Horizontal"" >
|
||||
<FontIcon FontSize=""14"" Glyph=""""/>
|
||||
<TextBlock Margin=""10,0"" Text=""{ x:Bind Name, Mode=OneWay}""/>
|
||||
</StackPanel>
|
||||
</TreeViewItem>
|
||||
</DataTemplate>";
|
||||
|
||||
return (DataTemplate)Microsoft.UI.Xaml.Markup.XamlReader.Load(template);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user