Linux input provider - Style fixes

Nodes - Added display value node
Nodes - Updated help link
This commit is contained in:
Robert committed 2022-08-20 21:48:46 +02:00
1 parent f9b3bc9377
commit 7a7d0ab387
16 files changed
+780 -73

No files matched your search

@@ -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<string, DisplayValueNodeCustomViewModel>
{
public DisplayValueNode() : base("Display Value", "Displays an input value for testing purposes.")
{
Input = CreateInputPin<object>();
}
public InputPin<object> Input { get; }
public override void Evaluate()
{
}
}
@@ -0,0 +1,51 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:screens="clr-namespace:Artemis.VisualScripting.Nodes.Static.Screens"
xmlns:skiaSharp="clr-namespace:SkiaSharp;assembly=SkiaSharp"
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
xmlns:converters1="clr-namespace:Artemis.UI.Shared.Converters;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.VisualScripting.Nodes.Static.Screens.DisplayValueNodeCustomView"
x:DataType="screens:DisplayValueNodeCustomViewModel">
<UserControl.Resources>
<converters1:SKColorToStringConverter x:Key="SKColorToStringConverter" />
<converters1:SKColorToColorConverter x:Key="SKColorToColorConverter" />
</UserControl.Resources>
<ContentControl Content="{CompiledBinding CurrentValue}" VerticalContentAlignment="Center">
<ContentControl.DataTemplates>
<DataTemplate DataType="skiaSharp:SKColor">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock x:Name="HexDisplay"
Text="{CompiledBinding Converter={StaticResource SKColorToStringConverter}}"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
FontFamily="Consolas"/>
<Border Margin="5 0 0 0"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
BorderThickness="1"
MinWidth="18"
MinHeight="18"
Background="{DynamicResource CheckerboardBrush}"
BorderBrush="{DynamicResource ColorPickerButtonOutline}"
CornerRadius="4"
ClipToBounds="True">
<Border CornerRadius="4">
<Border.Background>
<SolidColorBrush Color="{Binding Converter={StaticResource SKColorToColorConverter}}" />
</Border.Background>
</Border>
</Border>
</StackPanel>
</DataTemplate>
<DataTemplate DataType="core:Numeric">
<TextBlock Text="{Binding}" FontFamily="Consolas"/>
</DataTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" FontFamily="Consolas"/>
</DataTemplate>
</ContentControl.DataTemplates>
</ContentControl>
</UserControl>
@@ -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<DisplayValueNodeCustomViewModel>
{
public DisplayValueNodeCustomView()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
@@ -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;
}
}
+106 -11
View File
@@ -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",