Update icon assets

This commit is contained in:
2026-02-01 01:54:04 +09:00
parent 6505099667
commit 9fcf06dbe4
55 changed files with 225 additions and 255 deletions

View File

@@ -4,7 +4,6 @@ using Ghost.Editor.Core.Inspector;
using Ghost.Editor.Core.Notifications;
using Ghost.Editor.Core.Progress;
using Ghost.Editor.Utilities;
using Ghost.Engine.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.UI.Xaml;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 831 B

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 B

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 831 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -1,10 +1,9 @@
using Ghost.Core;
using Ghost.Data.Models;
using Ghost.Data.Services;
using Ghost.Editor.Core.AssetHandle;
using Ghost.Editor.View.Windows;
using Ghost.Engine;
using Ghost.Engine.Services;
using Microsoft.UI.Xaml.Media;
namespace Ghost.Editor.Core.AppState;
@@ -13,63 +12,49 @@ internal class EditorState : IAppState
private EngineEditorWindow? _window;
private EngineCore? _engineCore;
public Task OnExitingAsync()
public ValueTask<Result> OnExitingAsync()
{
if (App.Window == _window)
{
App.Window = null;
}
_engineCore?.ShutDown();
CompositionTarget.Rendering -= OnRendering;
_engineCore?.Dispose();
return Task.CompletedTask;
return ValueTask.FromResult(Result.Success());
}
public Task OnEnteringAsync(object? parameter)
public ValueTask<Result> OnEnteringAsync(object? parameter)
{
if (parameter is not ProjectMetadataInfo metadataInfo)
{
throw new ArgumentException("Parameter must be of type ProjectMetadata.", nameof(parameter));
return ValueTask.FromResult(Result.Failure("Invalid parameter for entering EditorState."));
}
ProjectService.CurrentProject = metadataInfo;
_engineCore = App.GetService<EngineCore>();
_engineCore.Init(new Engine.Models.LaunchArgument());
CompositionTarget.Rendering += OnRendering;
_engineCore.Init();
_window = App.GetService<EngineEditorWindow>();
_window.Activate();
App.Window = _window;
return Task.CompletedTask;
return ValueTask.FromResult(Result.Success());
}
public Task OnExitedAsync()
public ValueTask<Result> OnExitedAsync()
{
_window?.Close();
_window = null;
return Task.CompletedTask;
return ValueTask.FromResult(Result.Success());
}
public Task OnEnteredAsync(object? parameter)
public async ValueTask<Result> OnEnteredAsync(object? parameter)
{
AssetDatabase.Initialize();
return Task.CompletedTask;
}
private void OnRendering(object? sender, object e)
{
if (GraphicsPipeline.WaitForGPUReady(0))
{
_window?.DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.High, () =>
{
PlayerLoopService.Update();
GraphicsPipeline.SignalCPUReady();
});
}
await AssetDatabase.Initialize();
return Result.Success();
}
}

View File

@@ -1,3 +1,4 @@
using Ghost.Core;
using Ghost.Editor.View.Windows;
namespace Ghost.Editor.Core.AppState;
@@ -6,36 +7,36 @@ internal class LandingState : IAppState
{
private LandingWindow? _window;
public Task OnExitingAsync()
public ValueTask<Result> OnExitingAsync()
{
if (App.Window == _window)
{
App.Window = null;
}
return Task.CompletedTask;
return ValueTask.FromResult(Result.Success());
}
public Task OnEnteringAsync(object? parameter)
public ValueTask<Result> OnEnteringAsync(object? parameter)
{
_window = App.GetService<LandingWindow>();
_window.Activate();
App.Window = _window;
return Task.CompletedTask;
return ValueTask.FromResult(Result.Success());
}
public Task OnExitedAsync()
public ValueTask<Result> OnExitedAsync()
{
_window?.Close();
_window = null;
return Task.CompletedTask;
return ValueTask.FromResult(Result.Success());
}
public Task OnEnteredAsync(object? parameter)
public ValueTask<Result> OnEnteredAsync(object? parameter)
{
return Task.CompletedTask;
return ValueTask.FromResult(Result.Success());
}
}

View File

@@ -11,7 +11,6 @@
<!-- in .net 10, field keyword is not preview anymore, but we are still waiting roslyn team to update their code analyzer packages -->
<langversion>preview</langversion>
</PropertyGroup>
<ItemGroup>
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />

View File

@@ -1,5 +1,6 @@
using Ghost.Engine.Utilities;
using Microsoft.UI.Xaml.Data;
using Misaki.HighPerformance.Mathematics;
using System.Numerics;
namespace Ghost.Editor.Utilities.Converters;
@@ -8,20 +9,21 @@ public partial class Vector3ToQuaternionConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (value is Vector3 vector)
if (value is float3 vector)
{
return Quaternion.CreateFromYawPitchRoll(vector.Y, vector.X, vector.Z);
return quaternion.EulerXYZ(vector);
}
throw new ArgumentException("Value must be of type System.Numerics.Vector3.", nameof(value));
throw new ArgumentException($"Value must be of type {typeof(float3)}.", nameof(value));
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
if (value is Quaternion quaternion)
if (value is quaternion qua)
{
return VectorUtility.CreateFromQuaternion(quaternion);
return math.EulerXYZ(qua);
}
throw new ArgumentException("Value must be of type System.Numerics.Quaternion.", nameof(value));
throw new ArgumentException($"Value must be of type {typeof(quaternion)}.", nameof(value));
}
}

View File

@@ -72,7 +72,7 @@
<TextBlock
IsTextSelectionEnabled="True"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind ViewModel.SelectedLog.ToStringWithStackTrace(), Mode=OneWay}"
Text="{x:Bind ViewModel.SelectedLog.ToString(), Mode=OneWay}"
TextWrapping="Wrap" />
</ScrollViewer>
</Grid>

View File

@@ -35,10 +35,10 @@
</internal:NavigationTabPage.Resources>
<Grid Padding="4,6" Background="{ThemeResource LayerFillColorDefaultBrush}">
<TreeView ItemsSource="{x:Bind ViewModel.SceneList}" SelectionChanged="TreeView_SelectionChanged">
<!--<TreeView ItemsSource="{x:Bind ViewModel.SceneList}" SelectionChanged="TreeView_SelectionChanged">
<TreeView.ItemTemplateSelector>
<local:HierarchyTemplateSector EntityTemplate="{StaticResource EntityTemplate}" WorldTemplate="{StaticResource SceneTemplate}" />
<local:HierarchyTemplateSector />
</TreeView.ItemTemplateSelector>
</TreeView>
</TreeView>-->
</Grid>
</internal:NavigationTabPage>

View File

@@ -49,31 +49,13 @@ internal sealed partial class HierarchyPage : NavigationTabPage
internal partial class HierarchyTemplateSector : DataTemplateSelector
{
public DataTemplate? WorldTemplate
{
get;
set;
}
public DataTemplate? EntityTemplate
{
get;
set;
}
protected override DataTemplate SelectTemplateCore(object item)
{
if (WorldTemplate == null || EntityTemplate == null)
if (item is not SceneGraphNode node)
{
return base.SelectTemplateCore(item);
}
var node = (SceneGraphNode)item;
return node.NodeType switch
{
SceneGraphNodeType.Scene => WorldTemplate,
SceneGraphNodeType.Entity => EntityTemplate,
_ => base.SelectTemplateCore(item)
};
return node.GetSceneHierarchyTemplate();
}
}

View File

@@ -26,19 +26,19 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<IconSourceElement
<!--<IconSourceElement
Grid.Column="0"
Margin="0,0,15,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IconSource="{x:Bind ViewModel.Inspectable.Icon, Mode=OneWay}" />
<ContentPresenter Grid.Column="1" Content="{x:Bind ViewModel.Inspectable.HeaderContent, Mode=OneWay}" />
IconSource="{x:Bind ViewModel.Inspectable.Icon, Mode=OneWay}" />-->
<!--<ContentPresenter Grid.Column="1" Content="{x:Bind ViewModel.Inspectable.HeaderContent, Mode=OneWay}" />-->
</Grid>
<!-- Content -->
<Grid Grid.Row="1" Padding="0,0,0,0">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ContentPresenter Content="{x:Bind ViewModel.Inspectable.InspectorContent, Mode=OneWay}" />
<!--<ContentPresenter Content="{x:Bind ViewModel.Inspectable.InspectorContent, Mode=OneWay}" />-->
</ScrollViewer>
</Grid>
</Grid>

View File

@@ -1,45 +1,45 @@
using Ghost.Editor.Controls.Internal;
using Ghost.Graphics.Contracts;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using WinRT;
//using Ghost.Graphics.Contracts;
//using Microsoft.UI.Xaml;
//using Microsoft.UI.Xaml.Controls;
//using WinRT;
namespace Ghost.Editor.View.Pages.EngineEditor;
internal sealed partial class ScenePage : NavigationTabPage
{
private Renderer? _renderView;
private ISwapChainPanelNative _swapChainPanelNative;
//private Renderer? _renderView;
//private ISwapChainPanelNative _swapChainPanelNative;
public ScenePage()
{
InitializeComponent();
SwapChainPanel.Loaded += SwapChainPanel_Loaded;
SwapChainPanel.Unloaded += SwapChainPanel_Unloaded;
SwapChainPanel.SizeChanged += SwapChainPanel_SizeChanged;
//SwapChainPanel.Loaded += SwapChainPanel_Loaded;
//SwapChainPanel.Unloaded += SwapChainPanel_Unloaded;
//SwapChainPanel.SizeChanged += SwapChainPanel_SizeChanged;
}
private void SwapChainPanel_Loaded(object sender, RoutedEventArgs e)
{
var guid = typeof(ISwapChainPanelNative.Interface).GUID;
((IWinRTObject)SwapChainPanel).NativeObject.TryAs(guid, out var swapChainPanelNativeHandle);
_swapChainPanelNative = new ISwapChainPanelNative(swapChainPanelNativeHandle);
//private void SwapChainPanel_Loaded(object sender, RoutedEventArgs e)
//{
// var guid = typeof(ISwapChainPanelNative.Interface).GUID;
// ((IWinRTObject)SwapChainPanel).NativeObject.TryAs(guid, out var swapChainPanelNativeHandle);
// _swapChainPanelNative = new ISwapChainPanelNative(swapChainPanelNativeHandle);
_renderView = GraphicsPipeline.GraphicsDevice.CreateRenderer(new(_swapChainPanelNative, (uint)SwapChainPanel.ActualWidth, (uint)SwapChainPanel.ActualHeight));
}
// _renderView = GraphicsPipeline.GraphicsDevice.CreateRenderer(new(_swapChainPanelNative, (uint)SwapChainPanel.ActualWidth, (uint)SwapChainPanel.ActualHeight));
//}
private void SwapChainPanel_Unloaded(object sender, RoutedEventArgs e)
{
_swapChainPanelNative.Dispose();
_renderView?.Dispose();
}
//private void SwapChainPanel_Unloaded(object sender, RoutedEventArgs e)
//{
// _swapChainPanelNative.Dispose();
// _renderView?.Dispose();
//}
private void SwapChainPanel_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (e.NewSize.Width > 8.0 && e.NewSize.Height > 8.0)
{
_renderView?.RequestResize((uint)e.NewSize.Width, (uint)e.NewSize.Height);
}
}
//private void SwapChainPanel_SizeChanged(object sender, SizeChangedEventArgs e)
//{
// if (e.NewSize.Width > 8.0 && e.NewSize.Height > 8.0)
// {
// _renderView?.RequestResize((uint)e.NewSize.Width, (uint)e.NewSize.Height);
// }
//}
}

View File

@@ -1,18 +1,13 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Ghost.Engine.Models;
using Ghost.Engine.Services;
using Ghost.Core;
using System.Collections.ObjectModel;
namespace Ghost.Editor.ViewModels.Pages.EngineEditor;
internal partial class ConsoleViewModel : ObservableObject
{
[ObservableProperty]
public partial ObservableCollection<LogMessage> Logs
{
get; set;
} = new();
public ReadOnlyObservableCollection<LogMessage> Logs => Logger.Logs;
[ObservableProperty]
public partial bool ShowInfo
@@ -44,44 +39,10 @@ internal partial class ConsoleViewModel : ObservableObject
get; set;
}
public ConsoleViewModel()
{
foreach (var log in Logger.Logs)
{
Logs.Add(log);
}
Logger.OnLogsUpdate += UpdateLogs;
}
~ConsoleViewModel()
{
Logger.OnLogsUpdate -= UpdateLogs;
}
private void UpdateLogs(LogChangeContext ctx)
{
switch (ctx.changeType)
{
case LogChangeType.LogAdded:
Logs.Add(Logger.Logs[ctx.index]);
break;
case LogChangeType.LogRemoved:
if (Logs.Count > 0)
{
Logs.RemoveAt(ctx.index);
}
break;
case LogChangeType.LogsCleared:
Logs.Clear();
break;
}
}
partial void OnShowStackTraceChanged(bool value)
{
Logger.HasStackTrace = value;
Logger.LogInfo($"Stack trace visibility set to {value}.");
//Logger.HasStackTrace = value;
//Logger.LogInfo($"Stack trace visibility set to {value}.");
}
[RelayCommand]
@@ -89,4 +50,4 @@ internal partial class ConsoleViewModel : ObservableObject
{
Logger.Clear();
}
}
}

View File

@@ -7,32 +7,32 @@ namespace Ghost.Editor.ViewModels.Pages.EngineEditor;
internal partial class HierarchyViewModel : ObservableObject, INavigationAware
{
[ObservableProperty]
public partial ObservableCollection<SceneNode> SceneList
{
get;
private set;
} = new(EditorSceneManager.LoadedWorlds);
//[ObservableProperty]
//public partial ObservableCollection<SceneNode> SceneList
//{
// get;
// private set;
//} = new(EditorSceneManager.LoadedWorlds);
private void OnWorldLoaded(SceneNode node)
{
SceneList.Add(node);
}
//private void OnWorldLoaded(SceneNode node)
//{
// SceneList.Add(node);
//}
private void OnWorldUnloaded(SceneNode node)
{
SceneList.Remove(node);
}
//private void OnWorldUnloaded(SceneNode node)
//{
// SceneList.Remove(node);
//}
public void OnNavigatedTo(object? parameter)
{
EditorSceneManager.OnWorldLoaded += OnWorldLoaded;
EditorSceneManager.OnWorldUnloaded += OnWorldUnloaded;
//EditorSceneManager.OnWorldLoaded += OnWorldLoaded;
//EditorSceneManager.OnWorldUnloaded += OnWorldUnloaded;
}
public void OnNavigatedFrom()
{
EditorSceneManager.OnWorldLoaded -= OnWorldLoaded;
EditorSceneManager.OnWorldUnloaded -= OnWorldUnloaded;
//EditorSceneManager.OnWorldLoaded -= OnWorldLoaded;
//EditorSceneManager.OnWorldUnloaded -= OnWorldUnloaded;
}
}