1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Merge branch 'development'

This commit is contained in:
Robert 2021-04-17 10:22:44 +02:00
commit e3d991a0a2
28 changed files with 1537 additions and 92 deletions

View File

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Platforms>x64</Platforms>
<AssemblyName>Artemis.UI.Console</AssemblyName>
<RootNamespace>Artemis.UI.Console</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
<PackageReference Include="Ninject" Version="3.3.4" />
<PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,50 @@
using System;
using System.Linq;
using System.Threading;
using Artemis.Core;
using Artemis.Core.Ninject;
using Artemis.Core.Services;
using Ninject;
namespace Artemis.UI.Console
{
/// <summary>
/// This is just a little experiment to show that Artemis can run without the UI and even on other OSes
/// Some notes
/// - Any plugin relying on WPF and/or Artemis.UI.Shared won't load
/// - There is no input provider so key-press events and brushes won't work
/// - Device providers using Windows SDKs won't work, OpenRGB will though!
/// - You may need to fiddle around to get SkiaSharp binaries going
/// - There is no UI obviously
/// </summary>
internal class Program
{
private static readonly AutoResetEvent Closing = new(false);
protected static void OnExit(object sender, ConsoleCancelEventArgs args)
{
Closing.Set();
}
private static void Main(string[] args)
{
Utilities.PrepareFirstLaunch();
Utilities.ShutdownRequested += UtilitiesOnShutdownRequested;
StandardKernel kernel = new() {Settings = {InjectNonPublic = true}};
kernel.Load<CoreModule>();
ICoreService core = kernel.Get<ICoreService>();
core.StartupArguments = args.ToList();
core.IsElevated = false;
core.Initialize();
System.Console.CancelKeyPress += OnExit;
Closing.WaitOne();
}
private static void UtilitiesOnShutdownRequested(object sender, EventArgs e)
{
Closing.Set();
}
}
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<PublishDir>bin\publish\linux</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
</PropertyGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -50,6 +50,7 @@
<PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Enrichers.Demystify" Version="1.0.0-dev-00019" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="SkiaSharp" Version="2.80.2" />

View File

@ -1,5 +1,6 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Artemis.Core.Properties;
namespace Artemis.Core
{
@ -44,6 +45,7 @@ namespace Artemis.Core
/// .
/// </param>
/// <returns><c>true</c> if the value was changed, <c>false</c> if the existing value matched the desired value.</returns>
[NotifyPropertyChangedInvocator]
protected virtual bool SetAndNotify<T>(ref T storage, T value, [CallerMemberName] string propertyName = null)
{
if (!RequiresUpdate(ref storage, value)) return false;

View File

@ -109,6 +109,9 @@ namespace Artemis.Core
/// </summary>
public List<ArtemisDeviceInputIdentifier> InputIdentifiers { get; }
/// <summary>
/// Gets a list of input mappings configured on the device
/// </summary>
public Dictionary<ArtemisLed, ArtemisLed> InputMappings { get; }
/// <summary>
@ -288,7 +291,10 @@ namespace Artemis.Core
/// Attempts to retrieve the <see cref="ArtemisLed" /> that corresponds the provided RGB.NET <see cref="Led" />
/// </summary>
/// <param name="led">The RGB.NET <see cref="Led" /> to find the corresponding <see cref="ArtemisLed" /> for </param>
/// <param name="applyInputMapping">If <see langword="true"/>, LEDs mapped to different LEDs <see cref="InputMappings"/> are taken into consideration</param>
/// <param name="applyInputMapping">
/// If <see langword="true" />, LEDs mapped to different LEDs <see cref="InputMappings" />
/// are taken into consideration
/// </param>
/// <returns>If found, the corresponding <see cref="ArtemisLed" />; otherwise <see langword="null" />.</returns>
public ArtemisLed? GetLed(Led led, bool applyInputMapping)
{
@ -299,7 +305,10 @@ namespace Artemis.Core
/// Attempts to retrieve the <see cref="ArtemisLed" /> that corresponds the provided RGB.NET <see cref="LedId" />
/// </summary>
/// <param name="ledId">The RGB.NET <see cref="LedId" /> to find the corresponding <see cref="ArtemisLed" /> for </param>
/// <param name="applyInputMapping">If <see langword="true"/>, LEDs mapped to different LEDs <see cref="InputMappings"/> are taken into consideration</param>
/// <param name="applyInputMapping">
/// If <see langword="true" />, LEDs mapped to different LEDs <see cref="InputMappings" />
/// are taken into consideration
/// </param>
/// <returns>If found, the corresponding <see cref="ArtemisLed" />; otherwise <see langword="null" />.</returns>
public ArtemisLed? GetLed(LedId ledId, bool applyInputMapping)
{
@ -329,12 +338,31 @@ namespace Artemis.Core
return fileName;
}
/// <summary>
/// Occurs when the underlying RGB.NET device was updated
/// </summary>
public event EventHandler? DeviceUpdated;
/// <summary>
/// Invokes the <see cref="DeviceUpdated" /> event
/// </summary>
protected virtual void OnDeviceUpdated()
{
DeviceUpdated?.Invoke(this, EventArgs.Empty);
}
/// <summary>
/// Applies the provided layout to the device
/// </summary>
/// <param name="layout">The layout to apply</param>
/// <param name="createMissingLeds">A boolean indicating whether to add missing LEDs defined in the layout but missing on the device</param>
/// <param name="removeExcessiveLeds">A boolean indicating whether to remove excess LEDs present in the device but missing in the layout</param>
/// <param name="createMissingLeds">
/// A boolean indicating whether to add missing LEDs defined in the layout but missing on
/// the device
/// </param>
/// <param name="removeExcessiveLeds">
/// A boolean indicating whether to remove excess LEDs present in the device but missing
/// in the layout
/// </param>
internal void ApplyLayout(ArtemisLayout layout, bool createMissingLeds, bool removeExcessiveLeds)
{
if (createMissingLeds && !DeviceProvider.CreateMissingLedsSupported)
@ -355,21 +383,6 @@ namespace Artemis.Core
OnDeviceUpdated();
}
private void UpdateLeds()
{
Leds = RgbDevice.Select(l => new ArtemisLed(l, this)).ToList().AsReadOnly();
LedIds = new ReadOnlyDictionary<LedId, ArtemisLed>(Leds.ToDictionary(l => l.RgbLed.Id, l => l));
InputMappings.Clear();
foreach (InputMappingEntity deviceEntityInputMapping in DeviceEntity.InputMappings)
{
ArtemisLed? original = Leds.FirstOrDefault(l => l.RgbLed.Id == (LedId) deviceEntityInputMapping.OriginalLedId);
ArtemisLed? mapped = Leds.FirstOrDefault(l => l.RgbLed.Id == (LedId) deviceEntityInputMapping.MappedLedId);
if (original != null && mapped != null)
InputMappings.Add(original, mapped);
}
}
internal void ApplyToEntity()
{
// Other properties are computed
@ -427,6 +440,21 @@ namespace Artemis.Core
Path = path;
}
private void UpdateLeds()
{
Leds = RgbDevice.Select(l => new ArtemisLed(l, this)).ToList().AsReadOnly();
LedIds = new ReadOnlyDictionary<LedId, ArtemisLed>(Leds.ToDictionary(l => l.RgbLed.Id, l => l));
InputMappings.Clear();
foreach (InputMappingEntity deviceEntityInputMapping in DeviceEntity.InputMappings)
{
ArtemisLed? original = Leds.FirstOrDefault(l => l.RgbLed.Id == (LedId) deviceEntityInputMapping.OriginalLedId);
ArtemisLed? mapped = Leds.FirstOrDefault(l => l.RgbLed.Id == (LedId) deviceEntityInputMapping.MappedLedId);
if (original != null && mapped != null)
InputMappings.Add(original, mapped);
}
}
private void ApplyKeyboardLayout()
{
if (RgbDevice.DeviceInfo.DeviceType != RGBDeviceType.Keyboard)
@ -443,22 +471,5 @@ namespace Artemis.Core
else
LogicalLayout = DeviceEntity.LogicalLayout;
}
#region Events
/// <summary>
/// Occurs when the underlying RGB.NET device was updated
/// </summary>
public event EventHandler? DeviceUpdated;
/// <summary>
/// Invokes the <see cref="DeviceUpdated" /> event
/// </summary>
protected virtual void OnDeviceUpdated()
{
DeviceUpdated?.Invoke(this, EventArgs.Empty);
}
#endregion
}
}

View File

@ -1,17 +1,18 @@
using Artemis.Core.Services;
using RGB.NET.Core;
namespace Artemis.Core
namespace Artemis.Core
{
/// <summary>
/// Represents a device input identifier used by a specific <see cref="Services.InputProvider" /> to identify the device
/// Represents a device input identifier used by a specific <see cref="Services.InputProvider" /> to identify the
/// device
/// </summary>
public class ArtemisDeviceInputIdentifier
{
/// <summary>
/// Creates a new instance of the <see cref="ArtemisDeviceInputIdentifier" /> class
/// </summary>
/// <param name="inputProvider">The full type and namespace of the <see cref="Services.InputProvider" /> this identifier is used by</param>
/// <param name="inputProvider">
/// The full type and namespace of the <see cref="Services.InputProvider" /> this identifier is
/// used by
/// </param>
/// <param name="identifier">A value used to identify the device</param>
internal ArtemisDeviceInputIdentifier(string inputProvider, object identifier)
{
@ -29,16 +30,4 @@ namespace Artemis.Core
/// </summary>
public object Identifier { get; set; }
}
public class ArtemisDeviceInputMapping
{
public ArtemisLed OriginalLed { get; }
public ArtemisLed MappedLed { get; }
internal ArtemisDeviceInputMapping(ArtemisLed originalLed, ArtemisLed mappedLed)
{
OriginalLed = originalLed;
MappedLed = mappedLed;
}
}
}

View File

@ -16,7 +16,10 @@ namespace Artemis.Core.Ninject
.WriteTo.File(Constants.DataFolder + "logs/Artemis log-.log",
rollingInterval: RollingInterval.Day,
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}")
.WriteTo.Console()
#if DEBUG
.WriteTo.Debug()
#endif
.WriteTo.Sink<ArtemisSink>()
.MinimumLevel.ControlledBy(LoggingLevelSwitch)
.CreateLogger();

View File

@ -41,6 +41,8 @@ namespace Artemis.Core.LayerBrushes
if (!IsEnabled)
throw new ArtemisPluginException(Plugin, "Can only add a layer brush descriptor when the plugin is enabled");
if (icon.ToLower().EndsWith(".svg"))
icon = Plugin.ResolveRelativePath(icon);
LayerBrushDescriptor descriptor = new(displayName, description, icon, typeof(T), this);
_layerBrushDescriptors.Add(descriptor);
LayerBrushStore.Add(descriptor);

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
namespace Artemis.Core.LayerEffects
{
@ -33,14 +34,16 @@ namespace Artemis.Core.LayerEffects
/// <param name="displayName">The name to display in the UI</param>
/// <param name="description">The description to display in the UI</param>
/// <param name="icon">
/// The Material icon to display in the UI, a full reference can be found
/// <see href="https://materialdesignicons.com">here</see>
/// The Material icon to display in the UI, a full reference can be found <see href="https://materialdesignicons.com">here</see>.
/// <para>May also be a path to an SVG file relative to the directory of the plugin.</para>
/// </param>
protected void RegisterLayerEffectDescriptor<T>(string displayName, string description, string icon) where T : BaseLayerEffect
{
if (!IsEnabled)
throw new ArtemisPluginFeatureException(this, "Can only add a layer effect descriptor when the plugin is enabled");
if (icon.ToLower().EndsWith(".svg"))
icon = Plugin.ResolveRelativePath(icon);
LayerEffectDescriptor descriptor = new(displayName, description, icon, typeof(T), this);
_layerEffectDescriptors.Add(descriptor);
LayerEffectStore.Add(descriptor);

View File

@ -98,6 +98,18 @@
"Serilog": "2.7.1"
}
},
"Serilog.Sinks.Console": {
"type": "Direct",
"requested": "[3.1.1, )",
"resolved": "3.1.1",
"contentHash": "56mI5AqvyF/i/c2451nvV71kq370XOCE4Uu5qiaJ295sOhMb9q3BWwG7mWLOVSnmpWiq0SBT3SXfgRXGNP6vzA==",
"dependencies": {
"Serilog": "2.5.0",
"System.Console": "4.3.0",
"System.Runtime.InteropServices": "4.3.0",
"System.Runtime.InteropServices.RuntimeInformation": "4.3.0"
}
},
"Serilog.Sinks.Debug": {
"type": "Direct",
"requested": "[2.0.0, )",

View File

@ -330,14 +330,15 @@ namespace Artemis.UI.Shared
private void Render()
{
DrawingContext drawingContext = _backingStore.Open();
DrawingContext drawingContext = _backingStore.Append();
// DrawingContext drawingContext = _backingStore.Open();
if (HighlightedLeds != null && HighlightedLeds.Any())
foreach (DeviceVisualizerLed deviceVisualizerLed in _deviceVisualizerLeds)
deviceVisualizerLed.RenderColor(drawingContext, !HighlightedLeds.Contains(deviceVisualizerLed.Led));
deviceVisualizerLed.RenderColor(_backingStore, drawingContext, !HighlightedLeds.Contains(deviceVisualizerLed.Led));
else
foreach (DeviceVisualizerLed deviceVisualizerLed in _deviceVisualizerLeds)
deviceVisualizerLed.RenderColor(drawingContext, false);
deviceVisualizerLed.RenderColor(_backingStore, drawingContext, false);
drawingContext.Close();
}

View File

@ -14,9 +14,10 @@ namespace Artemis.UI.Shared
{
private const byte Dimmed = 100;
private const byte NonDimmed = 255;
private GeometryDrawing? _geometryDrawing;
private Color _renderColor;
private SolidColorBrush? _renderColorBrush;
private Color _renderColor;
public DeviceVisualizerLed(ArtemisLed led)
{
@ -40,12 +41,13 @@ namespace Artemis.UI.Shared
public BitmapImage? LedImage { get; set; }
public Geometry? DisplayGeometry { get; private set; }
public void RenderColor(DrawingContext drawingContext, bool isDimmed)
public void RenderColor(DrawingGroup backingStore, DrawingContext drawingContext, bool isDimmed)
{
if (DisplayGeometry == null)
return;
_renderColorBrush ??= new SolidColorBrush();
_geometryDrawing ??= new GeometryDrawing(_renderColorBrush, null, new RectangleGeometry(LedRect));
byte r = Led.RgbLed.Color.GetR();
byte g = Led.RgbLed.Color.GetG();
@ -56,7 +58,10 @@ namespace Artemis.UI.Shared
_renderColor.G = g;
_renderColor.B = b;
_renderColorBrush.Color = _renderColor;
drawingContext.DrawRectangle(_renderColorBrush, null, LedRect);
if (!backingStore.Children.Contains(_geometryDrawing))
backingStore.Children.Add(_geometryDrawing);
}
public void RenderImage(DrawingContext drawingContext)

View File

@ -403,6 +403,17 @@
"Serilog": "2.7.1"
}
},
"Serilog.Sinks.Console": {
"type": "Transitive",
"resolved": "3.1.1",
"contentHash": "56mI5AqvyF/i/c2451nvV71kq370XOCE4Uu5qiaJ295sOhMb9q3BWwG7mWLOVSnmpWiq0SBT3SXfgRXGNP6vzA==",
"dependencies": {
"Serilog": "2.5.0",
"System.Console": "4.3.0",
"System.Runtime.InteropServices": "4.3.0",
"System.Runtime.InteropServices.RuntimeInformation": "4.3.0"
}
},
"Serilog.Sinks.Debug": {
"type": "Transitive",
"resolved": "2.0.0",
@ -1332,6 +1343,7 @@
"Ninject.Extensions.Conventions": "3.3.0",
"Serilog": "2.10.0",
"Serilog.Enrichers.Demystify": "1.0.0-dev-00019",
"Serilog.Sinks.Console": "3.1.1",
"Serilog.Sinks.Debug": "2.0.0",
"Serilog.Sinks.File": "4.1.0",
"SkiaSharp": "2.80.2",

View File

@ -55,7 +55,7 @@ namespace Artemis.UI.DefaultTypes.PropertyInput
Execute.PostToUIThread(async () =>
{
await Task.Delay(400);
_dialogService.ShowDialogAt<LayerBrushPresetViewModel>("LayerProperties", new Dictionary<string, object> {{"layerBrush", layer.LayerBrush}});
await _dialogService.ShowDialogAt<LayerBrushPresetViewModel>("LayerProperties", new Dictionary<string, object> {{"layerBrush", layer.LayerBrush}});
});
}
}

View File

@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared">
<DataTemplate x:Key="SimpleLayerBrushDescriptorTemplate">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="{Binding Icon}" Height="13" Width="13" Margin="0 1 3 0" />
<shared:ArtemisIcon Icon="{Binding Icon}" Height="13" Width="13" Margin="0 1 3 0" />
<TextBlock Text="{Binding DisplayName}" />
</StackPanel>
</DataTemplate>
@ -17,7 +18,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<materialDesign:PackIcon Grid.Row="0" Grid.RowSpan="2" Kind="{Binding Icon}" Height="20" Width="20" Margin="-5 -2 10 0" VerticalAlignment="Center" />
<shared:ArtemisIcon Grid.Row="0" Grid.RowSpan="2" Icon="{Binding Icon}" Height="20" Width="20" Margin="-5 -2 10 0" VerticalAlignment="Center" />
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding DisplayName}" TextWrapping="Wrap" MaxWidth="350" />
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Description}" TextWrapping="Wrap" MaxWidth="350" Foreground="{DynamicResource MaterialDesignNavigationItemSubheader}" />
</Grid>

View File

@ -8,6 +8,7 @@
xmlns:s="https://github.com/canton7/Stylet"
xmlns:behaviors="clr-namespace:Artemis.UI.Behaviors"
xmlns:layerEffect="clr-namespace:Artemis.Core.LayerEffects;assembly=Artemis.Core"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance local:EffectsViewModel}">
@ -38,7 +39,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<materialDesign:PackIcon Kind="{Binding Icon}" Width="20" Height="20" VerticalAlignment="Center" />
<shared:ArtemisIcon Icon="{Binding Icon}" Width="20" Height="20" VerticalAlignment="Center" />
<StackPanel Margin="8 0 0 0" Grid.Column="1" VerticalAlignment="Stretch">
<TextBlock FontWeight="Bold" Text="{Binding DisplayName}" TextWrapping="Wrap" />
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />

View File

@ -317,12 +317,12 @@
Margin="6"
Visibility="{Binding SelectedLayer, Converter={StaticResource NullToVisibilityConverter}}">
<materialDesign:PackIcon Kind="Layers" Width="16" />
<materialDesign:PackIcon Kind="{Binding SelectedLayer.LayerBrush.Descriptor.Icon}"
Width="16"
Margin="5 0 0 0"
ToolTip="{Binding SelectedLayer.LayerBrush.Descriptor.DisplayName, Mode=OneWay}"
Background="Transparent"
Visibility="{Binding SelectedLayer.LayerBrush, Converter={StaticResource NullToVisibilityConverter}}" />
<shared:ArtemisIcon Icon="{Binding SelectedLayer.LayerBrush.Descriptor.Icon}"
Width="16"
Margin="5 0 0 0"
ToolTip="{Binding SelectedLayer.LayerBrush.Descriptor.DisplayName, Mode=OneWay}"
Background="Transparent"
Visibility="{Binding SelectedLayer.LayerBrush, Converter={StaticResource NullToVisibilityConverter}}" />
<TextBlock Text="{Binding SelectedLayer.Name}" Margin="5 0 0 0" />
</StackPanel>
<StackPanel Grid.Column="0"

View File

@ -322,6 +322,9 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
false,
keyframeViewModels.Where(k => k != sourceKeyframeViewModel).Select(k => k.Position).ToList()
);
// If holding down control, round to the closest 50ms
else if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
cursorTime = TimeSpan.FromMilliseconds(Math.Round(cursorTime.TotalMilliseconds / 50.0) * 50.0);
sourceKeyframeViewModel.UpdatePosition(cursorTime);

View File

@ -9,11 +9,12 @@
xmlns:converters="clr-namespace:Artemis.UI.Converters"
xmlns:dd="urn:gong-wpf-dragdrop"
xmlns:layerProperties="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance local:TreeGroupViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
<converters:PropertyTreeMarginConverter Length="20" x:Key="PropertyTreeMarginConverter" />
</UserControl.Resources>
@ -105,9 +106,11 @@
</Style.Triggers>
</Style>
</Grid.Style>
<materialDesign:PackIcon Grid.Column="0"
Kind="{Binding LayerPropertyGroup.LayerBrush.Descriptor.Icon}"
Margin="0 5 5 0" />
<shared:ArtemisIcon Grid.Column="0"
Icon="{Binding LayerPropertyGroup.LayerBrush.Descriptor.Icon}"
Width="16"
Height="16"
Margin="0 5 5 0" />
<TextBlock Grid.Column="1"
ToolTip="{Binding LayerPropertyGroup.LayerBrush.Descriptor.Description}"
Margin="0 5 0 0">
@ -151,10 +154,12 @@
</Style.Triggers>
</Style>
</Grid.Style>
<materialDesign:PackIcon
<shared:ArtemisIcon
Grid.Column="0"
Cursor="SizeNS"
Kind="{Binding LayerPropertyGroup.LayerEffect.Descriptor.Icon}"
Icon="{Binding LayerPropertyGroup.LayerEffect.Descriptor.Icon}"
Width="16"
Height="16"
Margin="0 5 5 0"
Background="Transparent" />
<TextBlock Grid.Column="1" ToolTip="{Binding LayerPropertyGroup.LayerEffect.Descriptor.Description}" Margin="0 5 0 0">

View File

@ -6,7 +6,9 @@
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:treeItem1="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem"
xmlns:Converters="clr-namespace:Artemis.UI.Converters" x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem.LayerView"
xmlns:Converters="clr-namespace:Artemis.UI.Converters"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem.LayerView"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance {x:Type treeItem1:LayerViewModel}}">
@ -53,14 +55,14 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<materialDesign:PackIcon Grid.Column="0" Kind="Layers" Width="16" VerticalAlignment="Center" />
<materialDesign:PackIcon Grid.Column="1"
VerticalAlignment="Center"
Kind="{Binding Layer.LayerBrush.Descriptor.Icon}"
Width="16"
Margin="5 0 0 0"
ToolTip="{Binding Layer.LayerBrush.Descriptor.DisplayName, Mode=OneWay}"
Visibility="{Binding ShowIcons, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}"
Background="Transparent" />
<shared:ArtemisIcon Grid.Column="1"
VerticalAlignment="Center"
Icon="{Binding Layer.LayerBrush.Descriptor.Icon}"
Width="16"
Margin="5 0 0 0"
ToolTip="{Binding Layer.LayerBrush.Descriptor.DisplayName, Mode=OneWay}"
Visibility="{Binding ShowIcons, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}"
Background="Transparent" />
<TextBlock Grid.Column="2" Text="{Binding Layer.Name}" VerticalAlignment="Center" Margin="5 0 0 0" />
<ToggleButton Grid.Column="3"
Style="{StaticResource MaterialDesignFlatToggleButton}"

View File

@ -7,6 +7,7 @@
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:windows="clr-namespace:Artemis.UI.Screens.ProfileEditor.Windows"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
mc:Ignorable="d"
Title="Layer brush configuration"
Background="{DynamicResource MaterialDesignPaper}"
@ -25,7 +26,7 @@
<DockPanel>
<controls:AppBar Type="Dense" Title="{Binding ActiveItem.LayerBrush.Descriptor.DisplayName}" DockPanel.Dock="Top" Margin="-18 0 0 0" ShowShadow="False">
<controls:AppBar.AppIcon>
<materialDesign:PackIcon Kind="{Binding ActiveItem.LayerBrush.Descriptor.Icon}" Width="20" Height="28" />
<shared:ArtemisIcon Icon="{Binding ActiveItem.LayerBrush.Descriptor.Icon}" Width="20" Height="28" />
</controls:AppBar.AppIcon>
</controls:AppBar>

View File

@ -7,6 +7,7 @@
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:windows="clr-namespace:Artemis.UI.Screens.ProfileEditor.Windows"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
mc:Ignorable="d"
Title="Layer effect configuration"
Background="{DynamicResource MaterialDesignPaper}"
@ -23,7 +24,7 @@
<DockPanel>
<controls:AppBar Type="Dense" Title="{Binding ActiveItem.LayerEffect.Descriptor.DisplayName}" DockPanel.Dock="Top" Margin="-18 0 0 0" ShowShadow="False">
<controls:AppBar.AppIcon>
<materialDesign:PackIcon Kind="{Binding ActiveItem.LayerEffect.Descriptor.Icon}" Width="20" Height="28" />
<shared:ArtemisIcon Icon="{Binding ActiveItem.LayerEffect.Descriptor.Icon}" Width="20" Height="28" />
</controls:AppBar.AppIcon>
</controls:AppBar>

View File

@ -171,7 +171,7 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
try
{
await Task.Run(() => _pluginManagementService.EnablePlugin(Plugin, true));
await Task.Run(() => _pluginManagementService.EnablePlugin(Plugin, true, true));
}
catch (Exception e)
{

View File

@ -9,7 +9,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
mc:Ignorable="d"
Title="Plugin configuration"
Title="Plugin Configuration | Artemis"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
UseLayoutRounding="True"

View File

@ -492,6 +492,17 @@
"Serilog": "2.7.1"
}
},
"Serilog.Sinks.Console": {
"type": "Transitive",
"resolved": "3.1.1",
"contentHash": "56mI5AqvyF/i/c2451nvV71kq370XOCE4Uu5qiaJ295sOhMb9q3BWwG7mWLOVSnmpWiq0SBT3SXfgRXGNP6vzA==",
"dependencies": {
"Serilog": "2.5.0",
"System.Console": "4.3.0",
"System.Runtime.InteropServices": "4.3.0",
"System.Runtime.InteropServices.RuntimeInformation": "4.3.0"
}
},
"Serilog.Sinks.Debug": {
"type": "Transitive",
"resolved": "2.0.0",
@ -1453,6 +1464,7 @@
"Ninject.Extensions.Conventions": "3.3.0",
"Serilog": "2.10.0",
"Serilog.Enrichers.Demystify": "1.0.0-dev-00019",
"Serilog.Sinks.Console": "3.1.1",
"Serilog.Sinks.Debug": "2.0.0",
"Serilog.Sinks.File": "4.1.0",
"SkiaSharp": "2.80.2",

View File

@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.Core", "Artemis.Cor
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.UI.Shared", "Artemis.UI.Shared\Artemis.UI.Shared.csproj", "{ADB357E6-151D-4D0D-87CB-68FD0BC29812}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.UI.Console", "Artemis.ConsoleUI\Artemis.UI.Console.csproj", "{ACCC50FD-611A-41C4-B58F-DDC80B47D0CF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -33,6 +35,10 @@ Global
{ADB357E6-151D-4D0D-87CB-68FD0BC29812}.Debug|x64.Build.0 = Debug|x64
{ADB357E6-151D-4D0D-87CB-68FD0BC29812}.Release|x64.ActiveCfg = Release|x64
{ADB357E6-151D-4D0D-87CB-68FD0BC29812}.Release|x64.Build.0 = Release|x64
{ACCC50FD-611A-41C4-B58F-DDC80B47D0CF}.Debug|x64.ActiveCfg = Debug|x64
{ACCC50FD-611A-41C4-B58F-DDC80B47D0CF}.Debug|x64.Build.0 = Debug|x64
{ACCC50FD-611A-41C4-B58F-DDC80B47D0CF}.Release|x64.ActiveCfg = Release|x64
{ACCC50FD-611A-41C4-B58F-DDC80B47D0CF}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE