Core - Made graphics context providable by UI

Windows - Implemented Vulkan graphics context
Splash screen - Tweaked design
This commit is contained in:
Robert committed 2022-05-06 18:19:02 +02:00
1 parent b2987b5190
commit 34407aaeec
18 files changed
+346 -25

No files matched your search

+4 -1
View File
@@ -3,8 +3,10 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svg="clr-namespace:Avalonia.Svg.Skia;assembly=Avalonia.Svg.Skia"
xmlns:root="clr-namespace:Artemis.UI.Screens.Root"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Root.SplashView"
x:DataType="root:SplashViewModel"
Icon="/Assets/Images/Logo/application.ico"
Title="Artemis 2.0"
Height="450"
@@ -20,12 +22,13 @@
</Image.Source>
</Image>
<TextBlock Grid.Row="1"
Classes="h5"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
TextWrapping="Wrap">
Artemis is initializing...
</TextBlock>
<TextBlock Grid.Row="2" HorizontalAlignment="Center" Text="{Binding Status}" />
<TextBlock Grid.Row="2" Classes="subtitle" HorizontalAlignment="Center" Text="{CompiledBinding Status}" />
<ProgressBar Grid.Row="3" IsIndeterminate="True" Margin="16 0" />
</Grid>
</Window>
@@ -55,7 +55,7 @@ namespace Artemis.UI.Screens.Root
private void PluginManagementServiceOnPluginFeatureEnabling(object? sender, PluginFeatureEventArgs e)
{
Status = "Enabling: " + e.PluginFeature.GetType().Name.Humanize();
Status = "Enabling: " + e.PluginFeature.Info.Name;
}
private void PluginManagementServiceOnPluginFeatureEnabled(object? sender, PluginFeatureEventArgs e)
@@ -13,6 +13,7 @@ using Artemis.Core.Services;
using Artemis.UI.Services.Interfaces;
using Artemis.UI.Shared;
using Avalonia;
using DynamicData;
using FluentAvalonia.Styling;
using ReactiveUI;
using Serilog.Events;
@@ -26,15 +27,19 @@ namespace Artemis.UI.Screens.Settings
private readonly IDebugService _debugService;
private readonly FluentAvaloniaTheme _fluentAvaloniaTheme;
public GeneralTabViewModel(ISettingsService settingsService, IPluginManagementService pluginManagementService, IDebugService debugService)
public GeneralTabViewModel(ISettingsService settingsService, IPluginManagementService pluginManagementService, IDebugService debugService, IGraphicsContextProvider? graphicsContextProvider)
{
DisplayName = "General";
_settingsService = settingsService;
_debugService = debugService;
_fluentAvaloniaTheme = AvaloniaLocator.Current.GetService<FluentAvaloniaTheme>();
List<LayerBrushProvider> layerBrushProviders = pluginManagementService.GetFeaturesOfType<LayerBrushProvider>();
LayerBrushDescriptors = new ObservableCollection<LayerBrushDescriptor>(layerBrushProviders.SelectMany(l => l.LayerBrushDescriptors));
GraphicsContexts = new ObservableCollection<string> {"Software"};
if (graphicsContextProvider != null)
GraphicsContexts.AddRange(graphicsContextProvider.GraphicsContextNames);
_defaultLayerBrushDescriptor = _settingsService.GetSetting("ProfileEditor.DefaultLayerBrushDescriptor", new LayerBrushReference
{
LayerBrushProviderId = "Artemis.Plugins.LayerBrushes.Color.ColorBrushProvider-92a9d6ba",
@@ -46,7 +51,7 @@ namespace Artemis.UI.Screens.Settings
ShowSetupWizard = ReactiveCommand.Create(ExecuteShowSetupWizard);
ShowDebugger = ReactiveCommand.Create(ExecuteShowDebugger);
ShowDataFolder = ReactiveCommand.Create(ExecuteShowDataFolder);
this.WhenActivated(d =>
{
UIColorScheme.SettingChanged += UIColorSchemeOnSettingChanged;
@@ -73,12 +78,7 @@ namespace Artemis.UI.Screens.Settings
public ReactiveCommand<Unit, Unit> ShowDataFolder { get; }
public ObservableCollection<LayerBrushDescriptor> LayerBrushDescriptors { get; }
public ObservableCollection<string> GraphicsContexts { get; } = new()
{
"Software",
"Vulkan"
};
public ObservableCollection<string> GraphicsContexts { get; }
public ObservableCollection<RenderSettingViewModel> RenderScales { get; } = new()
{
@@ -111,7 +111,7 @@ namespace Artemis.UI.Screens.Settings
get => RenderScales.FirstOrDefault(s => Math.Abs(s.Value - CoreRenderScale.Value) < 0.01);
set
{
if (value != null)
if (value != null)
CoreRenderScale.Value = value.Value;
}
}
@@ -121,7 +121,7 @@ namespace Artemis.UI.Screens.Settings
get => TargetFrameRates.FirstOrDefault(s => Math.Abs(s.Value - CoreTargetFrameRate.Value) < 0.01);
set
{
if (value != null)
if (value != null)
CoreTargetFrameRate.Value = (int) value.Value;
}
}