From d0781c00ef62d56a2569d0230b1b1de7306bd956 Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 1 Jul 2020 19:38:20 +0200 Subject: [PATCH] Display conditions - Added (empty) VMs and test views --- .../DisplayConditions.xaml | 40 ++++++ .../Abstract/DisplayConditionViewModel.cs | 16 +++ .../DisplayConditionGroupView.xaml | 69 +++++++++ .../DisplayConditionGroupViewModel.cs | 24 ++++ .../DisplayConditionPredicateView.xaml | 131 ++++++++++++++++++ .../DisplayConditionPredicateViewModel.cs | 16 +++ .../DisplayConditionView.xaml | 10 -- .../DisplayConditionViewModel.cs | 6 - .../DisplayConditionsView.xaml | 36 +++-- .../DisplayConditionsViewModel.cs | 23 ++- .../GeneralDataModel.cs | 2 +- 11 files changed, 340 insertions(+), 33 deletions(-) create mode 100644 src/Artemis.UI/ResourceDictionaries/DisplayConditions.xaml create mode 100644 src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/Abstract/DisplayConditionViewModel.cs create mode 100644 src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionGroupView.xaml create mode 100644 src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionGroupViewModel.cs create mode 100644 src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionPredicateView.xaml create mode 100644 src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionPredicateViewModel.cs delete mode 100644 src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionView.xaml delete mode 100644 src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionViewModel.cs diff --git a/src/Artemis.UI/ResourceDictionaries/DisplayConditions.xaml b/src/Artemis.UI/ResourceDictionaries/DisplayConditions.xaml new file mode 100644 index 000000000..74600c8d0 --- /dev/null +++ b/src/Artemis.UI/ResourceDictionaries/DisplayConditions.xaml @@ -0,0 +1,40 @@ + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/Abstract/DisplayConditionViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/Abstract/DisplayConditionViewModel.cs new file mode 100644 index 000000000..ae720885e --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/Abstract/DisplayConditionViewModel.cs @@ -0,0 +1,16 @@ +using Stylet; + +namespace Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions.Abstract +{ + public abstract class DisplayConditionViewModel : PropertyChangedBase + { + protected DisplayConditionViewModel() + { + Children = new BindableCollection(); + } + + public BindableCollection Children { get; } + + public abstract void Update(); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionGroupView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionGroupView.xaml new file mode 100644 index 000000000..d2e6082a9 --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionGroupView.xaml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionGroupViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionGroupViewModel.cs new file mode 100644 index 000000000..11e29b839 --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionGroupViewModel.cs @@ -0,0 +1,24 @@ +using Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions.Abstract; + +namespace Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions +{ + public class DisplayConditionGroupViewModel : DisplayConditionViewModel + { + private bool _isRootGroup; + + public bool IsRootGroup + { + get => _isRootGroup; + set => SetAndNotify(ref _isRootGroup, value); + } + + public DisplayConditionGroupViewModel() + { + } + + public override void Update() + { + + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionPredicateView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionPredicateView.xaml new file mode 100644 index 000000000..a5b8ed03a --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionPredicateView.xaml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionPredicateViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionPredicateViewModel.cs new file mode 100644 index 000000000..4aefbb41c --- /dev/null +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionPredicateViewModel.cs @@ -0,0 +1,16 @@ +using Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions.Abstract; + +namespace Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions +{ + public class DisplayConditionPredicateViewModel : DisplayConditionViewModel + { + public DisplayConditionPredicateViewModel() + { + + } + + public override void Update() + { + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionView.xaml deleted file mode 100644 index 02e4970f9..000000000 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionView.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionViewModel.cs deleted file mode 100644 index a67253375..000000000 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionViewModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions -{ - public class DisplayConditionViewModel - { - } -} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsView.xaml index 20de4c7ca..ab6cb5e15 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsView.xaml +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsView.xaml @@ -5,25 +5,31 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:s="https://github.com/canton7/Stylet" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> - - - Display conditions - - + + + + + + + + Display conditions + + - - - - Conditions are not yet implemented - - - Conditions will allow you to easily configure when a layer should be shown. - You'll also use this to set up how a layer reacts to its conditions being matched, like play the timeline once or keep repeating the timeline until the conditions are no longer matched. - - + + + + + + + + Disabled + + Enabled \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsViewModel.cs index b3a35f876..7a53fd84d 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/DisplayConditions/DisplayConditionsViewModel.cs @@ -1,6 +1,27 @@ -namespace Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions +using Stylet; + +namespace Artemis.UI.Screens.Module.ProfileEditor.DisplayConditions { public class DisplayConditionsViewModel : ProfileEditorPanelViewModel { + private DisplayConditionGroupViewModel _rootGroup; + + public DisplayConditionGroupViewModel RootGroup + { + get => _rootGroup; + set => SetAndNotify(ref _rootGroup, value); + } + + public DisplayConditionsViewModel() + { + RootGroup = new DisplayConditionGroupViewModel {IsRootGroup = true}; + var subGroup = new DisplayConditionGroupViewModel(); + + RootGroup.Children.Add(new DisplayConditionPredicateViewModel()); + RootGroup.Children.Add(new DisplayConditionPredicateViewModel()); + RootGroup.Children.Add(subGroup); + subGroup.Children.Add(new DisplayConditionPredicateViewModel()); + subGroup.Children.Add(new DisplayConditionPredicateViewModel()); + } } } \ No newline at end of file diff --git a/src/Plugins/Artemis.Plugins.Modules.General/GeneralDataModel.cs b/src/Plugins/Artemis.Plugins.Modules.General/GeneralDataModel.cs index c027f774e..4e53c6a3b 100644 --- a/src/Plugins/Artemis.Plugins.Modules.General/GeneralDataModel.cs +++ b/src/Plugins/Artemis.Plugins.Modules.General/GeneralDataModel.cs @@ -29,7 +29,7 @@ namespace Artemis.Plugins.Modules.General public List PlayerInfosList { get; set; } } - public class PlayerInfo : DataModel + public class PlayerInfo { [DataModelProperty(Name = "A test string", Description = "This is a test string that's not of any use outside testing!")] public string TestString { get; set; }