diff --git a/src/Artemis.UI.Linux/Providers/Input/LinuxInputDevice.cs b/src/Artemis.UI.Linux/Providers/Input/LinuxInputDevice.cs index 9fae6eee2..7f210ab8a 100644 --- a/src/Artemis.UI.Linux/Providers/Input/LinuxInputDevice.cs +++ b/src/Artemis.UI.Linux/Providers/Input/LinuxInputDevice.cs @@ -41,7 +41,7 @@ namespace Artemis.UI.Linux.Providers.Input else if (Handlers?.Any(h => h.Contains("js")) == true) DeviceType = LinuxDeviceType.Gamepad; - var evt = Handlers!.First(h => h.Contains("event")); + string evt = Handlers!.First(h => h.Contains("event")); EventPath = $"/dev/input/{evt}"; break; @@ -73,7 +73,7 @@ namespace Artemis.UI.Linux.Providers.Input public LinuxInputId(string line) { - var components = line.Split(" ") + Dictionary components = line.Split(" ") .Select(c => c.Split('=')) .ToDictionary(c => c[0], c => c[1]); diff --git a/src/Artemis.UI.Linux/Providers/Input/LinuxInputProvider.cs b/src/Artemis.UI.Linux/Providers/Input/LinuxInputProvider.cs index 65422712d..acd226d99 100644 --- a/src/Artemis.UI.Linux/Providers/Input/LinuxInputProvider.cs +++ b/src/Artemis.UI.Linux/Providers/Input/LinuxInputProvider.cs @@ -54,7 +54,7 @@ namespace Artemis.UI.Linux.Providers.Input _logger.Verbose($"Keyboard Key: {(LinuxKeyboardKeyCodes)args.Code} | Down: {isDown}"); - var identifier = keyboard.InputId; + LinuxInputDevice.LinuxInputId identifier = keyboard.InputId; OnIdentifierReceived(identifier, InputDeviceType.Keyboard); @@ -79,7 +79,7 @@ namespace Artemis.UI.Linux.Providers.Input private void HandleMouseData(LinuxInputDevice mouse, LinuxInputEventArgs args) { - var identifier = mouse.InputId; + LinuxInputDevice.LinuxInputId identifier = mouse.InputId; OnIdentifierReceived(identifier, InputDeviceType.Mouse); diff --git a/src/Artemis.UI.Linux/packages.lock.json b/src/Artemis.UI.Linux/packages.lock.json index 2064c8127..5c1ceadc6 100644 --- a/src/Artemis.UI.Linux/packages.lock.json +++ b/src/Artemis.UI.Linux/packages.lock.json @@ -30,6 +30,18 @@ "Avalonia.X11": "0.10.18" } }, + "Avalonia.Diagnostics": { + "type": "Direct", + "requested": "[0.10.18, )", + "resolved": "0.10.18", + "contentHash": "3PjA6r0mmRUeS+R34VtYAyzmlPeqflsQ9B8E2TrZKGke0Wo6t3JsvPWA8ynA/ii0icPnnn7nmQaEZQs07ZthxQ==", + "dependencies": { + "Avalonia": "0.10.18", + "Avalonia.Controls.DataGrid": "0.10.18", + "Microsoft.CodeAnalysis.CSharp.Scripting": "3.4.0", + "System.Reactive": "5.0.0" + } + }, "Avalonia.ReactiveUI": { "type": "Direct", "requested": "[0.10.18, )", @@ -58,11 +70,11 @@ }, "Avalonia.Controls.DataGrid": { "type": "Transitive", - "resolved": "0.10.15", - "contentHash": "a0A0RcZU1FSCUxKHkYP49df9HjlvU9gdS+DqF6VR7zc3TYbaFwLHF0pg5fsjkW/FMgzUfO70NX/WwpDeu6celg==", + "resolved": "0.10.18", + "contentHash": "LDNZxnzk++GgBeUKsqmeWJDQgF83C4Quk4Wn0z5P6vIm1f5YSSFJL6JbibbIAvjqlGjqWWFTBZpHMUNjdyw4Aw==", "dependencies": { - "Avalonia": "0.10.15", - "Avalonia.Remote.Protocol": "0.10.15", + "Avalonia": "0.10.18", + "Avalonia.Remote.Protocol": "0.10.18", "JetBrains.Annotations": "10.3.0", "System.Reactive": "5.0.0" } @@ -328,6 +340,75 @@ "resolved": "0.10.4", "contentHash": "enc2U+/1UnF3rtocxb5ofcg7cJSmJI4adbYPr8DZa5bQzvhqA/VbjlcalxoqjI3CR2RvM5WWpjKT0p3BriFJjw==" }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "2.9.6", + "contentHash": "Kmms3TxGQMNb95Cu/3K+0bIcMnV4qf/phZBLAB0HUi65rBPxP4JO3aM2LoAcb+DFS600RQJMZ7ZLyYDTbLwJOQ==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "3ncA7cV+iXGA1VYwe2UEZXcvWyZSlbexWjM9AvocP7sik5UD93qt9Hq0fMRGk0jFRmvmE4T2g+bGfXiBVZEhLw==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "2.9.6", + "System.Collections.Immutable": "1.5.0", + "System.Memory": "4.5.3", + "System.Reflection.Metadata": "1.6.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2", + "System.Text.Encoding.CodePages": "4.5.1", + "System.Threading.Tasks.Extensions": "4.5.3" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "/LsTtgcMN6Tu1oo7/WYbRAHL4/ubXC/miEakwTpcZKJKtFo7D0AK95Hw0dbGxul6C8WJu60v6NP2435TDYZM+Q==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.CSharp.Scripting": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "tLgqc76qXHmONUhWhxo7z3TcL/LmGFWIUJm1exbQmVJohuQvJnejUMxmVkdxDfMuMZU1fIyJXPZ6Fkp4FEneAg==", + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "Microsoft.CodeAnalysis.CSharp": "[3.4.0]", + "Microsoft.CodeAnalysis.Common": "[3.4.0]", + "Microsoft.CodeAnalysis.Scripting.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.Scripting.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "+b6I3DZL2zvck+B/E/aiOveakj5U2G2BcYODQxcGh2IDbatNU3XXxGT1HumkWB5uIZI2Leu0opBgBpjScmjGMA==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, "Microsoft.DotNet.PlatformAbstractions": { "type": "Transitive", "resolved": "3.1.6", @@ -741,6 +822,11 @@ "System.Threading.Tasks": "4.3.0" } }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, "System.Collections.NonGeneric": { "type": "Transitive", "resolved": "4.3.0", @@ -1198,6 +1284,11 @@ "System.Runtime": "4.3.0" } }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, "System.Reflection.Primitives": { "type": "Transitive", "resolved": "4.3.0", @@ -1518,13 +1609,8 @@ }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } + "resolved": "4.5.3", + "contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==" }, "System.Threading.Timer": { "type": "Transitive", @@ -1690,6 +1776,7 @@ "Avalonia.Controls.PanAndZoom": "10.14.0", "Avalonia.Controls.Skia": "0.10.16", "Avalonia.Desktop": "0.10.18", + "Avalonia.Diagnostics": "0.10.18", "Avalonia.ReactiveUI": "0.10.18", "Avalonia.Xaml.Behaviors": "0.10.18", "DynamicData": "7.9.14", @@ -1710,6 +1797,7 @@ "dependencies": { "Artemis.Core": "1.0.0", "Avalonia": "0.10.18", + "Avalonia.Diagnostics": "0.10.18", "Avalonia.ReactiveUI": "0.10.18", "Avalonia.Xaml.Behaviors": "0.10.18", "DynamicData": "7.9.14", diff --git a/src/Artemis.UI.MacOS/packages.lock.json b/src/Artemis.UI.MacOS/packages.lock.json index 2064c8127..5c1ceadc6 100644 --- a/src/Artemis.UI.MacOS/packages.lock.json +++ b/src/Artemis.UI.MacOS/packages.lock.json @@ -30,6 +30,18 @@ "Avalonia.X11": "0.10.18" } }, + "Avalonia.Diagnostics": { + "type": "Direct", + "requested": "[0.10.18, )", + "resolved": "0.10.18", + "contentHash": "3PjA6r0mmRUeS+R34VtYAyzmlPeqflsQ9B8E2TrZKGke0Wo6t3JsvPWA8ynA/ii0icPnnn7nmQaEZQs07ZthxQ==", + "dependencies": { + "Avalonia": "0.10.18", + "Avalonia.Controls.DataGrid": "0.10.18", + "Microsoft.CodeAnalysis.CSharp.Scripting": "3.4.0", + "System.Reactive": "5.0.0" + } + }, "Avalonia.ReactiveUI": { "type": "Direct", "requested": "[0.10.18, )", @@ -58,11 +70,11 @@ }, "Avalonia.Controls.DataGrid": { "type": "Transitive", - "resolved": "0.10.15", - "contentHash": "a0A0RcZU1FSCUxKHkYP49df9HjlvU9gdS+DqF6VR7zc3TYbaFwLHF0pg5fsjkW/FMgzUfO70NX/WwpDeu6celg==", + "resolved": "0.10.18", + "contentHash": "LDNZxnzk++GgBeUKsqmeWJDQgF83C4Quk4Wn0z5P6vIm1f5YSSFJL6JbibbIAvjqlGjqWWFTBZpHMUNjdyw4Aw==", "dependencies": { - "Avalonia": "0.10.15", - "Avalonia.Remote.Protocol": "0.10.15", + "Avalonia": "0.10.18", + "Avalonia.Remote.Protocol": "0.10.18", "JetBrains.Annotations": "10.3.0", "System.Reactive": "5.0.0" } @@ -328,6 +340,75 @@ "resolved": "0.10.4", "contentHash": "enc2U+/1UnF3rtocxb5ofcg7cJSmJI4adbYPr8DZa5bQzvhqA/VbjlcalxoqjI3CR2RvM5WWpjKT0p3BriFJjw==" }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "2.9.6", + "contentHash": "Kmms3TxGQMNb95Cu/3K+0bIcMnV4qf/phZBLAB0HUi65rBPxP4JO3aM2LoAcb+DFS600RQJMZ7ZLyYDTbLwJOQ==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "3ncA7cV+iXGA1VYwe2UEZXcvWyZSlbexWjM9AvocP7sik5UD93qt9Hq0fMRGk0jFRmvmE4T2g+bGfXiBVZEhLw==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "2.9.6", + "System.Collections.Immutable": "1.5.0", + "System.Memory": "4.5.3", + "System.Reflection.Metadata": "1.6.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2", + "System.Text.Encoding.CodePages": "4.5.1", + "System.Threading.Tasks.Extensions": "4.5.3" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "/LsTtgcMN6Tu1oo7/WYbRAHL4/ubXC/miEakwTpcZKJKtFo7D0AK95Hw0dbGxul6C8WJu60v6NP2435TDYZM+Q==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.CSharp.Scripting": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "tLgqc76qXHmONUhWhxo7z3TcL/LmGFWIUJm1exbQmVJohuQvJnejUMxmVkdxDfMuMZU1fIyJXPZ6Fkp4FEneAg==", + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "Microsoft.CodeAnalysis.CSharp": "[3.4.0]", + "Microsoft.CodeAnalysis.Common": "[3.4.0]", + "Microsoft.CodeAnalysis.Scripting.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.Scripting.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "+b6I3DZL2zvck+B/E/aiOveakj5U2G2BcYODQxcGh2IDbatNU3XXxGT1HumkWB5uIZI2Leu0opBgBpjScmjGMA==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, "Microsoft.DotNet.PlatformAbstractions": { "type": "Transitive", "resolved": "3.1.6", @@ -741,6 +822,11 @@ "System.Threading.Tasks": "4.3.0" } }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, "System.Collections.NonGeneric": { "type": "Transitive", "resolved": "4.3.0", @@ -1198,6 +1284,11 @@ "System.Runtime": "4.3.0" } }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, "System.Reflection.Primitives": { "type": "Transitive", "resolved": "4.3.0", @@ -1518,13 +1609,8 @@ }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } + "resolved": "4.5.3", + "contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==" }, "System.Threading.Timer": { "type": "Transitive", @@ -1690,6 +1776,7 @@ "Avalonia.Controls.PanAndZoom": "10.14.0", "Avalonia.Controls.Skia": "0.10.16", "Avalonia.Desktop": "0.10.18", + "Avalonia.Diagnostics": "0.10.18", "Avalonia.ReactiveUI": "0.10.18", "Avalonia.Xaml.Behaviors": "0.10.18", "DynamicData": "7.9.14", @@ -1710,6 +1797,7 @@ "dependencies": { "Artemis.Core": "1.0.0", "Avalonia": "0.10.18", + "Avalonia.Diagnostics": "0.10.18", "Avalonia.ReactiveUI": "0.10.18", "Avalonia.Xaml.Behaviors": "0.10.18", "DynamicData": "7.9.14", diff --git a/src/Artemis.UI.Shared/Services/Interfaces/IWindowService.cs b/src/Artemis.UI.Shared/Services/Interfaces/IWindowService.cs index f10d6c2fc..3dc4ec6af 100644 --- a/src/Artemis.UI.Shared/Services/Interfaces/IWindowService.cs +++ b/src/Artemis.UI.Shared/Services/Interfaces/IWindowService.cs @@ -31,6 +31,20 @@ namespace Artemis.UI.Shared.Services /// The exception to display void ShowExceptionDialog(string title, Exception exception); + /// + /// Creates a view model instance of type and shows its corresponding View as a + /// dialog + /// + /// The type of view model to create + /// The created view model + Task ShowDialogAsync(params (string name, object value)[] parameters); + + /// + /// Given a ViewModel, show its corresponding View as a dialog + /// + /// ViewModel to show the View for + Task ShowDialogAsync(object viewModel); + /// /// Given an existing ViewModel, show its corresponding View as a Dialog /// diff --git a/src/Artemis.UI.Shared/Services/Window/WindowService.cs b/src/Artemis.UI.Shared/Services/Window/WindowService.cs index 5348f2574..772ebab81 100644 --- a/src/Artemis.UI.Shared/Services/Window/WindowService.cs +++ b/src/Artemis.UI.Shared/Services/Window/WindowService.cs @@ -53,6 +53,32 @@ namespace Artemis.UI.Shared.Services return window; } + public async Task ShowDialogAsync(params (string name, object value)[] parameters) + { + IParameter[] paramsArray = parameters.Select(kv => new ConstructorArgument(kv.name, kv.value)).Cast().ToArray(); + T viewModel = _kernel.Get(paramsArray)!; + await ShowDialogAsync(viewModel); + return viewModel; + } + + public async Task ShowDialogAsync(object viewModel) + { + Window? parent = GetCurrentWindow(); + + string name = viewModel.GetType().FullName!.Split('`')[0].Replace("ViewModel", "View"); + Type? type = viewModel.GetType().Assembly.GetType(name); + + if (type == null) + throw new ArtemisSharedUIException($"Failed to find a window named {name}."); + + if (!type.IsAssignableTo(typeof(Window))) + throw new ArtemisSharedUIException($"Type {name} is not a window."); + + Window window = (Window) Activator.CreateInstance(type)!; + window.DataContext = viewModel; + await window.ShowDialog(parent); + } + public async Task ShowDialogAsync(params (string name, object? value)[] parameters) where TViewModel : DialogViewModelBase { IParameter[] paramsArray = parameters.Select(kv => new ConstructorArgument(kv.name, kv.value)).Cast().ToArray(); @@ -119,7 +145,7 @@ namespace Artemis.UI.Shared.Services throw new ArtemisSharedUIException("Can't show a content dialog without any windows being shown."); return new ContentDialogBuilder(_kernel, currentWindow); } - + public OpenFolderDialogBuilder CreateOpenFolderDialog() { Window? currentWindow = GetCurrentWindow(); diff --git a/src/Artemis.UI.Shared/packages.lock.json b/src/Artemis.UI.Shared/packages.lock.json index bf966a26d..2a1592c73 100644 --- a/src/Artemis.UI.Shared/packages.lock.json +++ b/src/Artemis.UI.Shared/packages.lock.json @@ -17,6 +17,18 @@ "System.ValueTuple": "4.5.0" } }, + "Avalonia.Diagnostics": { + "type": "Direct", + "requested": "[0.10.18, )", + "resolved": "0.10.18", + "contentHash": "3PjA6r0mmRUeS+R34VtYAyzmlPeqflsQ9B8E2TrZKGke0Wo6t3JsvPWA8ynA/ii0icPnnn7nmQaEZQs07ZthxQ==", + "dependencies": { + "Avalonia": "0.10.18", + "Avalonia.Controls.DataGrid": "0.10.18", + "Microsoft.CodeAnalysis.CSharp.Scripting": "3.4.0", + "System.Reactive": "5.0.0" + } + }, "Avalonia.ReactiveUI": { "type": "Direct", "requested": "[0.10.18, )", @@ -113,11 +125,11 @@ }, "Avalonia.Controls.DataGrid": { "type": "Transitive", - "resolved": "0.10.15", - "contentHash": "a0A0RcZU1FSCUxKHkYP49df9HjlvU9gdS+DqF6VR7zc3TYbaFwLHF0pg5fsjkW/FMgzUfO70NX/WwpDeu6celg==", + "resolved": "0.10.18", + "contentHash": "LDNZxnzk++GgBeUKsqmeWJDQgF83C4Quk4Wn0z5P6vIm1f5YSSFJL6JbibbIAvjqlGjqWWFTBZpHMUNjdyw4Aw==", "dependencies": { - "Avalonia": "0.10.15", - "Avalonia.Remote.Protocol": "0.10.15", + "Avalonia": "0.10.18", + "Avalonia.Remote.Protocol": "0.10.18", "JetBrains.Annotations": "10.3.0", "System.Reactive": "5.0.0" } @@ -316,6 +328,75 @@ "resolved": "0.10.4", "contentHash": "enc2U+/1UnF3rtocxb5ofcg7cJSmJI4adbYPr8DZa5bQzvhqA/VbjlcalxoqjI3CR2RvM5WWpjKT0p3BriFJjw==" }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "2.9.6", + "contentHash": "Kmms3TxGQMNb95Cu/3K+0bIcMnV4qf/phZBLAB0HUi65rBPxP4JO3aM2LoAcb+DFS600RQJMZ7ZLyYDTbLwJOQ==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "3ncA7cV+iXGA1VYwe2UEZXcvWyZSlbexWjM9AvocP7sik5UD93qt9Hq0fMRGk0jFRmvmE4T2g+bGfXiBVZEhLw==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "2.9.6", + "System.Collections.Immutable": "1.5.0", + "System.Memory": "4.5.3", + "System.Reflection.Metadata": "1.6.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2", + "System.Text.Encoding.CodePages": "4.5.1", + "System.Threading.Tasks.Extensions": "4.5.3" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "/LsTtgcMN6Tu1oo7/WYbRAHL4/ubXC/miEakwTpcZKJKtFo7D0AK95Hw0dbGxul6C8WJu60v6NP2435TDYZM+Q==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.CSharp.Scripting": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "tLgqc76qXHmONUhWhxo7z3TcL/LmGFWIUJm1exbQmVJohuQvJnejUMxmVkdxDfMuMZU1fIyJXPZ6Fkp4FEneAg==", + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "Microsoft.CodeAnalysis.CSharp": "[3.4.0]", + "Microsoft.CodeAnalysis.Common": "[3.4.0]", + "Microsoft.CodeAnalysis.Scripting.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.Scripting.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "+b6I3DZL2zvck+B/E/aiOveakj5U2G2BcYODQxcGh2IDbatNU3XXxGT1HumkWB5uIZI2Leu0opBgBpjScmjGMA==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, "Microsoft.DotNet.PlatformAbstractions": { "type": "Transitive", "resolved": "3.1.6", @@ -664,6 +745,11 @@ "System.Threading.Tasks": "4.3.0" } }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, "System.Collections.NonGeneric": { "type": "Transitive", "resolved": "4.3.0", @@ -1121,6 +1207,11 @@ "System.Runtime": "4.3.0" } }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, "System.Reflection.Primitives": { "type": "Transitive", "resolved": "4.3.0", @@ -1392,6 +1483,15 @@ "System.Runtime": "4.3.0" } }, + "System.Text.Encoding.CodePages": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "4J2JQXbftjPMppIHJ7IC+VXQ9XfEagN92vZZNoG12i+zReYlim5dMoXFC1Zzg7tsnKDM7JPo5bYfFK4Jheq44w==", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.1.2", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" + } + }, "System.Text.Encoding.Extensions": { "type": "Transitive", "resolved": "4.3.0", @@ -1432,13 +1532,8 @@ }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } + "resolved": "4.5.3", + "contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==" }, "System.Threading.Timer": { "type": "Transitive", diff --git a/src/Artemis.UI.Windows/packages.lock.json b/src/Artemis.UI.Windows/packages.lock.json index 09ab3921e..4ce21430a 100644 --- a/src/Artemis.UI.Windows/packages.lock.json +++ b/src/Artemis.UI.Windows/packages.lock.json @@ -30,6 +30,18 @@ "Avalonia.X11": "0.10.18" } }, + "Avalonia.Diagnostics": { + "type": "Direct", + "requested": "[0.10.18, )", + "resolved": "0.10.18", + "contentHash": "3PjA6r0mmRUeS+R34VtYAyzmlPeqflsQ9B8E2TrZKGke0Wo6t3JsvPWA8ynA/ii0icPnnn7nmQaEZQs07ZthxQ==", + "dependencies": { + "Avalonia": "0.10.18", + "Avalonia.Controls.DataGrid": "0.10.18", + "Microsoft.CodeAnalysis.CSharp.Scripting": "3.4.0", + "System.Reactive": "5.0.0" + } + }, "Avalonia.ReactiveUI": { "type": "Direct", "requested": "[0.10.18, )", @@ -107,11 +119,11 @@ }, "Avalonia.Controls.DataGrid": { "type": "Transitive", - "resolved": "0.10.15", - "contentHash": "a0A0RcZU1FSCUxKHkYP49df9HjlvU9gdS+DqF6VR7zc3TYbaFwLHF0pg5fsjkW/FMgzUfO70NX/WwpDeu6celg==", + "resolved": "0.10.18", + "contentHash": "LDNZxnzk++GgBeUKsqmeWJDQgF83C4Quk4Wn0z5P6vIm1f5YSSFJL6JbibbIAvjqlGjqWWFTBZpHMUNjdyw4Aw==", "dependencies": { - "Avalonia": "0.10.15", - "Avalonia.Remote.Protocol": "0.10.15", + "Avalonia": "0.10.18", + "Avalonia.Remote.Protocol": "0.10.18", "JetBrains.Annotations": "10.3.0", "System.Reactive": "5.0.0" } @@ -366,6 +378,75 @@ "resolved": "0.10.4", "contentHash": "enc2U+/1UnF3rtocxb5ofcg7cJSmJI4adbYPr8DZa5bQzvhqA/VbjlcalxoqjI3CR2RvM5WWpjKT0p3BriFJjw==" }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "2.9.6", + "contentHash": "Kmms3TxGQMNb95Cu/3K+0bIcMnV4qf/phZBLAB0HUi65rBPxP4JO3aM2LoAcb+DFS600RQJMZ7ZLyYDTbLwJOQ==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "3ncA7cV+iXGA1VYwe2UEZXcvWyZSlbexWjM9AvocP7sik5UD93qt9Hq0fMRGk0jFRmvmE4T2g+bGfXiBVZEhLw==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "2.9.6", + "System.Collections.Immutable": "1.5.0", + "System.Memory": "4.5.3", + "System.Reflection.Metadata": "1.6.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2", + "System.Text.Encoding.CodePages": "4.5.1", + "System.Threading.Tasks.Extensions": "4.5.3" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "/LsTtgcMN6Tu1oo7/WYbRAHL4/ubXC/miEakwTpcZKJKtFo7D0AK95Hw0dbGxul6C8WJu60v6NP2435TDYZM+Q==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.CSharp.Scripting": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "tLgqc76qXHmONUhWhxo7z3TcL/LmGFWIUJm1exbQmVJohuQvJnejUMxmVkdxDfMuMZU1fIyJXPZ6Fkp4FEneAg==", + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "Microsoft.CodeAnalysis.CSharp": "[3.4.0]", + "Microsoft.CodeAnalysis.Common": "[3.4.0]", + "Microsoft.CodeAnalysis.Scripting.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.Scripting.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "+b6I3DZL2zvck+B/E/aiOveakj5U2G2BcYODQxcGh2IDbatNU3XXxGT1HumkWB5uIZI2Leu0opBgBpjScmjGMA==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, "Microsoft.DotNet.PlatformAbstractions": { "type": "Transitive", "resolved": "3.1.6", @@ -797,6 +878,11 @@ "System.Threading.Tasks": "4.3.0" } }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, "System.Collections.NonGeneric": { "type": "Transitive", "resolved": "4.3.0", @@ -1254,6 +1340,11 @@ "System.Runtime": "4.3.0" } }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, "System.Reflection.Primitives": { "type": "Transitive", "resolved": "4.3.0", @@ -1574,13 +1665,8 @@ }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } + "resolved": "4.5.3", + "contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==" }, "System.Threading.Timer": { "type": "Transitive", @@ -1746,6 +1832,7 @@ "Avalonia.Controls.PanAndZoom": "10.14.0", "Avalonia.Controls.Skia": "0.10.16", "Avalonia.Desktop": "0.10.18", + "Avalonia.Diagnostics": "0.10.18", "Avalonia.ReactiveUI": "0.10.18", "Avalonia.Xaml.Behaviors": "0.10.18", "DynamicData": "7.9.14", @@ -1766,6 +1853,7 @@ "dependencies": { "Artemis.Core": "1.0.0", "Avalonia": "0.10.18", + "Avalonia.Diagnostics": "0.10.18", "Avalonia.ReactiveUI": "0.10.18", "Avalonia.Xaml.Behaviors": "0.10.18", "DynamicData": "7.9.14", diff --git a/src/Artemis.UI/Screens/VisualScripting/NodeScriptWindowView.axaml b/src/Artemis.UI/Screens/VisualScripting/NodeScriptWindowView.axaml index 3bda40218..e37a84702 100644 --- a/src/Artemis.UI/Screens/VisualScripting/NodeScriptWindowView.axaml +++ b/src/Artemis.UI/Screens/VisualScripting/NodeScriptWindowView.axaml @@ -165,7 +165,7 @@ Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Right" - NavigateUri="https://wiki.artemis-rgb.com/en/guides/user/profiles/conditions"> + NavigateUri="https://wiki.artemis-rgb.com/en/guides/user/profiles/nodes"> Learn more about visual scripts diff --git a/src/Artemis.UI/Services/RegistrationService.cs b/src/Artemis.UI/Services/RegistrationService.cs index f5c72034d..34479a5a9 100644 --- a/src/Artemis.UI/Services/RegistrationService.cs +++ b/src/Artemis.UI/Services/RegistrationService.cs @@ -100,7 +100,7 @@ public class RegistrationService : IRegistrationService { _nodeService.RegisterTypeColor(Constants.CorePlugin, typeof(bool), new SKColor(0xFFCD3232)); _nodeService.RegisterTypeColor(Constants.CorePlugin, typeof(string), new SKColor(0xFFFFD700)); - _nodeService.RegisterTypeColor(Constants.CorePlugin, typeof(int), new SKColor(0xFF32CD32)); + _nodeService.RegisterTypeColor(Constants.CorePlugin, typeof(Numeric), new SKColor(0xFF32CD32)); _nodeService.RegisterTypeColor(Constants.CorePlugin, typeof(float), new SKColor(0xFFFF7C00)); _nodeService.RegisterTypeColor(Constants.CorePlugin, typeof(SKColor), new SKColor(0xFFAD3EED)); _nodeService.RegisterTypeColor(Constants.CorePlugin, typeof(IList), new SKColor(0xFFED3E61)); diff --git a/src/Artemis.UI/packages.lock.json b/src/Artemis.UI/packages.lock.json index 3b738a163..514e5a064 100644 --- a/src/Artemis.UI/packages.lock.json +++ b/src/Artemis.UI/packages.lock.json @@ -50,6 +50,18 @@ "Avalonia.X11": "0.10.18" } }, + "Avalonia.Diagnostics": { + "type": "Direct", + "requested": "[0.10.18, )", + "resolved": "0.10.18", + "contentHash": "3PjA6r0mmRUeS+R34VtYAyzmlPeqflsQ9B8E2TrZKGke0Wo6t3JsvPWA8ynA/ii0icPnnn7nmQaEZQs07ZthxQ==", + "dependencies": { + "Avalonia": "0.10.18", + "Avalonia.Controls.DataGrid": "0.10.18", + "Microsoft.CodeAnalysis.CSharp.Scripting": "3.4.0", + "System.Reactive": "5.0.0" + } + }, "Avalonia.ReactiveUI": { "type": "Direct", "requested": "[0.10.18, )", @@ -185,11 +197,11 @@ }, "Avalonia.Controls.DataGrid": { "type": "Transitive", - "resolved": "0.10.15", - "contentHash": "a0A0RcZU1FSCUxKHkYP49df9HjlvU9gdS+DqF6VR7zc3TYbaFwLHF0pg5fsjkW/FMgzUfO70NX/WwpDeu6celg==", + "resolved": "0.10.18", + "contentHash": "LDNZxnzk++GgBeUKsqmeWJDQgF83C4Quk4Wn0z5P6vIm1f5YSSFJL6JbibbIAvjqlGjqWWFTBZpHMUNjdyw4Aw==", "dependencies": { - "Avalonia": "0.10.15", - "Avalonia.Remote.Protocol": "0.10.15", + "Avalonia": "0.10.18", + "Avalonia.Remote.Protocol": "0.10.18", "JetBrains.Annotations": "10.3.0", "System.Reactive": "5.0.0" } @@ -380,6 +392,75 @@ "resolved": "0.10.4", "contentHash": "enc2U+/1UnF3rtocxb5ofcg7cJSmJI4adbYPr8DZa5bQzvhqA/VbjlcalxoqjI3CR2RvM5WWpjKT0p3BriFJjw==" }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "2.9.6", + "contentHash": "Kmms3TxGQMNb95Cu/3K+0bIcMnV4qf/phZBLAB0HUi65rBPxP4JO3aM2LoAcb+DFS600RQJMZ7ZLyYDTbLwJOQ==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "3ncA7cV+iXGA1VYwe2UEZXcvWyZSlbexWjM9AvocP7sik5UD93qt9Hq0fMRGk0jFRmvmE4T2g+bGfXiBVZEhLw==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "2.9.6", + "System.Collections.Immutable": "1.5.0", + "System.Memory": "4.5.3", + "System.Reflection.Metadata": "1.6.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2", + "System.Text.Encoding.CodePages": "4.5.1", + "System.Threading.Tasks.Extensions": "4.5.3" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "/LsTtgcMN6Tu1oo7/WYbRAHL4/ubXC/miEakwTpcZKJKtFo7D0AK95Hw0dbGxul6C8WJu60v6NP2435TDYZM+Q==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.CSharp.Scripting": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "tLgqc76qXHmONUhWhxo7z3TcL/LmGFWIUJm1exbQmVJohuQvJnejUMxmVkdxDfMuMZU1fIyJXPZ6Fkp4FEneAg==", + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "Microsoft.CodeAnalysis.CSharp": "[3.4.0]", + "Microsoft.CodeAnalysis.Common": "[3.4.0]", + "Microsoft.CodeAnalysis.Scripting.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.Scripting.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "+b6I3DZL2zvck+B/E/aiOveakj5U2G2BcYODQxcGh2IDbatNU3XXxGT1HumkWB5uIZI2Leu0opBgBpjScmjGMA==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, "Microsoft.DotNet.PlatformAbstractions": { "type": "Transitive", "resolved": "3.1.6", @@ -754,6 +835,11 @@ "System.Threading.Tasks": "4.3.0" } }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, "System.Collections.NonGeneric": { "type": "Transitive", "resolved": "4.3.0", @@ -1211,6 +1297,11 @@ "System.Runtime": "4.3.0" } }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, "System.Reflection.Primitives": { "type": "Transitive", "resolved": "4.3.0", @@ -1531,13 +1622,8 @@ }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } + "resolved": "4.5.3", + "contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==" }, "System.Threading.Timer": { "type": "Transitive", @@ -1698,6 +1784,7 @@ "dependencies": { "Artemis.Core": "1.0.0", "Avalonia": "0.10.18", + "Avalonia.Diagnostics": "0.10.18", "Avalonia.ReactiveUI": "0.10.18", "Avalonia.Xaml.Behaviors": "0.10.18", "DynamicData": "7.9.14", diff --git a/src/Artemis.VisualScripting/Nodes/Static/DisplayValueNode.cs b/src/Artemis.VisualScripting/Nodes/Static/DisplayValueNode.cs new file mode 100644 index 000000000..ae5f457b7 --- /dev/null +++ b/src/Artemis.VisualScripting/Nodes/Static/DisplayValueNode.cs @@ -0,0 +1,19 @@ +using Artemis.Core; +using Artemis.VisualScripting.Nodes.Static.Screens; + +namespace Artemis.VisualScripting.Nodes.Static; + +[Node("Display Value", "Displays an input value for testing purposes.", "Static", InputType = typeof(object))] +public class DisplayValueNode : Node +{ + public DisplayValueNode() : base("Display Value", "Displays an input value for testing purposes.") + { + Input = CreateInputPin(); + } + + public InputPin Input { get; } + + public override void Evaluate() + { + } +} \ No newline at end of file diff --git a/src/Artemis.VisualScripting/Nodes/Static/Screens/DisplayValueNodeCustomView.axaml b/src/Artemis.VisualScripting/Nodes/Static/Screens/DisplayValueNodeCustomView.axaml new file mode 100644 index 000000000..ca473031e --- /dev/null +++ b/src/Artemis.VisualScripting/Nodes/Static/Screens/DisplayValueNodeCustomView.axaml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Artemis.VisualScripting/Nodes/Static/Screens/DisplayValueNodeCustomView.axaml.cs b/src/Artemis.VisualScripting/Nodes/Static/Screens/DisplayValueNodeCustomView.axaml.cs new file mode 100644 index 000000000..eec25ff0a --- /dev/null +++ b/src/Artemis.VisualScripting/Nodes/Static/Screens/DisplayValueNodeCustomView.axaml.cs @@ -0,0 +1,19 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using Avalonia.ReactiveUI; + +namespace Artemis.VisualScripting.Nodes.Static.Screens; + +public partial class DisplayValueNodeCustomView : ReactiveUserControl +{ + public DisplayValueNodeCustomView() + { + InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } +} \ No newline at end of file diff --git a/src/Artemis.VisualScripting/Nodes/Static/Screens/DisplayValueNodeCustomViewModel.cs b/src/Artemis.VisualScripting/Nodes/Static/Screens/DisplayValueNodeCustomViewModel.cs new file mode 100644 index 000000000..c15f5459d --- /dev/null +++ b/src/Artemis.VisualScripting/Nodes/Static/Screens/DisplayValueNodeCustomViewModel.cs @@ -0,0 +1,37 @@ +using System.Reactive.Disposables; +using Artemis.Core; +using Artemis.UI.Shared.VisualScripting; +using Avalonia.Threading; +using ReactiveUI; + +namespace Artemis.VisualScripting.Nodes.Static.Screens; + +public class DisplayValueNodeCustomViewModel : CustomNodeViewModel +{ + private readonly DisplayValueNode _node; + private object? _currentValue; + + public DisplayValueNodeCustomViewModel(DisplayValueNode node, INodeScript script) : base(node, script) + { + _node = node; + + // Because the DisplayValueNode has no output it never evaluates, manually do so here + this.WhenActivated(d => + { + DispatcherTimer updateTimer = new(TimeSpan.FromMilliseconds(25.0 / 1000), DispatcherPriority.Normal, Update); + updateTimer.Start(); + Disposable.Create(() => updateTimer.Stop()).DisposeWith(d); + }); + } + + public object? CurrentValue + { + get => _currentValue; + private set => this.RaiseAndSetIfChanged(ref _currentValue, value); + } + + private void Update(object? sender, EventArgs e) + { + CurrentValue = _node.Input.Value; + } +} \ No newline at end of file diff --git a/src/Artemis.VisualScripting/packages.lock.json b/src/Artemis.VisualScripting/packages.lock.json index bd1d243f5..54e2c950d 100644 --- a/src/Artemis.VisualScripting/packages.lock.json +++ b/src/Artemis.VisualScripting/packages.lock.json @@ -103,11 +103,11 @@ }, "Avalonia.Controls.DataGrid": { "type": "Transitive", - "resolved": "0.10.15", - "contentHash": "a0A0RcZU1FSCUxKHkYP49df9HjlvU9gdS+DqF6VR7zc3TYbaFwLHF0pg5fsjkW/FMgzUfO70NX/WwpDeu6celg==", + "resolved": "0.10.18", + "contentHash": "LDNZxnzk++GgBeUKsqmeWJDQgF83C4Quk4Wn0z5P6vIm1f5YSSFJL6JbibbIAvjqlGjqWWFTBZpHMUNjdyw4Aw==", "dependencies": { - "Avalonia": "0.10.15", - "Avalonia.Remote.Protocol": "0.10.15", + "Avalonia": "0.10.18", + "Avalonia.Remote.Protocol": "0.10.18", "JetBrains.Annotations": "10.3.0", "System.Reactive": "5.0.0" } @@ -124,6 +124,17 @@ "Avalonia.X11": "0.10.15" } }, + "Avalonia.Diagnostics": { + "type": "Transitive", + "resolved": "0.10.18", + "contentHash": "3PjA6r0mmRUeS+R34VtYAyzmlPeqflsQ9B8E2TrZKGke0Wo6t3JsvPWA8ynA/ii0icPnnn7nmQaEZQs07ZthxQ==", + "dependencies": { + "Avalonia": "0.10.18", + "Avalonia.Controls.DataGrid": "0.10.18", + "Microsoft.CodeAnalysis.CSharp.Scripting": "3.4.0", + "System.Reactive": "5.0.0" + } + }, "Avalonia.FreeDesktop": { "type": "Transitive", "resolved": "0.10.15", @@ -335,6 +346,75 @@ "resolved": "0.10.4", "contentHash": "enc2U+/1UnF3rtocxb5ofcg7cJSmJI4adbYPr8DZa5bQzvhqA/VbjlcalxoqjI3CR2RvM5WWpjKT0p3BriFJjw==" }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "2.9.6", + "contentHash": "Kmms3TxGQMNb95Cu/3K+0bIcMnV4qf/phZBLAB0HUi65rBPxP4JO3aM2LoAcb+DFS600RQJMZ7ZLyYDTbLwJOQ==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "3ncA7cV+iXGA1VYwe2UEZXcvWyZSlbexWjM9AvocP7sik5UD93qt9Hq0fMRGk0jFRmvmE4T2g+bGfXiBVZEhLw==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "2.9.6", + "System.Collections.Immutable": "1.5.0", + "System.Memory": "4.5.3", + "System.Reflection.Metadata": "1.6.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2", + "System.Text.Encoding.CodePages": "4.5.1", + "System.Threading.Tasks.Extensions": "4.5.3" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "/LsTtgcMN6Tu1oo7/WYbRAHL4/ubXC/miEakwTpcZKJKtFo7D0AK95Hw0dbGxul6C8WJu60v6NP2435TDYZM+Q==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.CSharp.Scripting": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "tLgqc76qXHmONUhWhxo7z3TcL/LmGFWIUJm1exbQmVJohuQvJnejUMxmVkdxDfMuMZU1fIyJXPZ6Fkp4FEneAg==", + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "Microsoft.CodeAnalysis.CSharp": "[3.4.0]", + "Microsoft.CodeAnalysis.Common": "[3.4.0]", + "Microsoft.CodeAnalysis.Scripting.Common": "[3.4.0]" + } + }, + "Microsoft.CodeAnalysis.Scripting.Common": { + "type": "Transitive", + "resolved": "3.4.0", + "contentHash": "+b6I3DZL2zvck+B/E/aiOveakj5U2G2BcYODQxcGh2IDbatNU3XXxGT1HumkWB5uIZI2Leu0opBgBpjScmjGMA==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[3.4.0]" + } + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, "Microsoft.DotNet.PlatformAbstractions": { "type": "Transitive", "resolved": "3.1.6", @@ -697,6 +777,11 @@ "System.Threading.Tasks": "4.3.0" } }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, "System.Collections.NonGeneric": { "type": "Transitive", "resolved": "4.3.0", @@ -1154,6 +1239,11 @@ "System.Runtime": "4.3.0" } }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, "System.Reflection.Primitives": { "type": "Transitive", "resolved": "4.3.0", @@ -1425,6 +1515,15 @@ "System.Runtime": "4.3.0" } }, + "System.Text.Encoding.CodePages": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "4J2JQXbftjPMppIHJ7IC+VXQ9XfEagN92vZZNoG12i+zReYlim5dMoXFC1Zzg7tsnKDM7JPo5bYfFK4Jheq44w==", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.1.2", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" + } + }, "System.Text.Encoding.Extensions": { "type": "Transitive", "resolved": "4.3.0", @@ -1465,13 +1564,8 @@ }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } + "resolved": "4.5.3", + "contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==" }, "System.Threading.Timer": { "type": "Transitive", @@ -1632,6 +1726,7 @@ "dependencies": { "Artemis.Core": "1.0.0", "Avalonia": "0.10.18", + "Avalonia.Diagnostics": "0.10.18", "Avalonia.ReactiveUI": "0.10.18", "Avalonia.Xaml.Behaviors": "0.10.18", "DynamicData": "7.9.14",