Merge branch 'development'

This commit is contained in:
Robert committed 2021-07-08 19:03:06 +02:00
commit 54f278c72f
21 files changed
+254 -49

No files matched your search

@@ -24,7 +24,8 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions
: base(dataModelConditionListPredicate, modules, profileEditorService, dataModelUIService, conditionOperatorService, settingsService)
{
_dataModelUIService = dataModelUIService;
DataModelPathSegment dataModelPathSegment = dataModelConditionListPredicate.LeftPath.Segments.ToList()[1];
var segmentDescription = dataModelPathSegment.GetPropertyDescription();
LeftSideColor = new SolidColorBrush(Color.FromRgb(71, 108, 188));
}
@@ -47,7 +48,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions
public override void Evaluate()
{
throw new NotImplementedException();
}
public override void UpdateModules()
@@ -88,7 +89,8 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions
private DataModelPropertiesViewModel GetListDataModel()
{
ListPredicateWrapperDataModel wrapper = ListPredicateWrapperDataModel.Create(
DataModelConditionListPredicate.DataModelConditionList.ListType
DataModelConditionListPredicate.DataModelConditionList.ListType!,
DataModelConditionListPredicate.DataModelConditionList.ListPath?.GetPropertyDescription()?.ListItemName
);
return wrapper.CreateViewModel(_dataModelUIService, new DataModelUpdateConfiguration(true));
@@ -4,7 +4,6 @@ using System.ComponentModel;
using System.Linq;
using Artemis.Core;
using Artemis.Core.Modules;
using Artemis.Core.Services;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.ProfileEditor.Conditions;
using Artemis.UI.Shared;
@@ -91,6 +90,8 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
protected override void OnInitialActivate()
{
_profileEditorService.SelectedProfileElementChanged += SelectedProfileEditorServiceOnSelectedProfileElementChanged;
Update(_profileEditorService.SelectedProfileElement);
base.OnInitialActivate();
}
@@ -101,6 +102,11 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
}
private void SelectedProfileEditorServiceOnSelectedProfileElementChanged(object sender, RenderProfileElementEventArgs e)
{
Update(e.RenderProfileElement);
}
private void Update(RenderProfileElement renderProfileElement)
{
if (RenderProfileElement != null)
{
@@ -109,26 +115,26 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
RenderProfileElement.Timeline.PropertyChanged -= TimelineOnPropertyChanged;
}
RenderProfileElement = e.RenderProfileElement;
RenderProfileElement = renderProfileElement;
NotifyOfPropertyChange(nameof(DisplayContinuously));
NotifyOfPropertyChange(nameof(AlwaysFinishTimeline));
NotifyOfPropertyChange(nameof(ConditionBehaviourEnabled));
if (e.RenderProfileElement == null)
if (renderProfileElement == null)
{
ActiveItem = null;
return;
}
// Ensure the layer has a root display condition group
if (e.RenderProfileElement.DisplayCondition == null)
e.RenderProfileElement.DisplayCondition = new DataModelConditionGroup(null);
if (renderProfileElement.DisplayCondition == null)
renderProfileElement.DisplayCondition = new DataModelConditionGroup(null);
List<Module> modules = new();
if (_profileEditorService.SelectedProfileConfiguration?.Module != null)
modules.Add(_profileEditorService.SelectedProfileConfiguration.Module);
ActiveItem = _dataModelConditionsVmFactory.DataModelConditionGroupViewModel(e.RenderProfileElement.DisplayCondition, ConditionGroupType.General, modules);
ActiveItem = _dataModelConditionsVmFactory.DataModelConditionGroupViewModel(renderProfileElement.DisplayCondition, ConditionGroupType.General, modules);
ActiveItem.IsRootGroup = true;
DisplayStartHint = !RenderProfileElement.DisplayCondition.Children.Any();
@@ -138,7 +144,7 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
RenderProfileElement.DisplayCondition.ChildRemoved += DisplayConditionOnChildrenModified;
RenderProfileElement.Timeline.PropertyChanged += TimelineOnPropertyChanged;
}
private void TimelineOnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
NotifyOfPropertyChange(nameof(DisplayContinuously));
@@ -122,7 +122,9 @@
<MenuItem Header="Display Data Model Values"
IsCheckable="True"
IsChecked="{Binding ShowDataModelValues.Value}"/>
<MenuItem Header="Display Full Condition Paths"
IsCheckable="True"
IsChecked="{Binding ShowFullPaths.Value}"/>
<MenuItem Header="Apply All Data Bindings During Edit"
ToolTip="If enabled, updates all data bindings instead of only the one you are editing"
IsCheckable="True"
@@ -118,6 +118,7 @@ namespace Artemis.UI.Screens.ProfileEditor
public PluginSetting<GridLength> ElementPropertiesWidth => _settingsService.GetSetting("ProfileEditor.ElementPropertiesWidth", new GridLength(545));
public PluginSetting<bool> StopOnFocusLoss => _settingsService.GetSetting("ProfileEditor.StopOnFocusLoss", true);
public PluginSetting<bool> ShowDataModelValues => _settingsService.GetSetting("ProfileEditor.ShowDataModelValues", false);
public PluginSetting<bool> ShowFullPaths => _settingsService.GetSetting("ProfileEditor.ShowFullPaths", true);
public PluginSetting<bool> FocusSelectedLayer => _settingsService.GetSetting("ProfileEditor.FocusSelectedLayer", true);
public PluginSetting<bool> AlwaysApplyDataBindings => _settingsService.GetSetting("ProfileEditor.AlwaysApplyDataBindings", true);
@@ -192,6 +193,7 @@ namespace Artemis.UI.Screens.ProfileEditor
{
StopOnFocusLoss.AutoSave = true;
ShowDataModelValues.AutoSave = true;
ShowFullPaths.AutoSave = true;
FocusSelectedLayer.AutoSave = true;
AlwaysApplyDataBindings.AutoSave = true;
@@ -205,6 +207,7 @@ namespace Artemis.UI.Screens.ProfileEditor
{
StopOnFocusLoss.AutoSave = false;
ShowDataModelValues.AutoSave = false;
ShowFullPaths.AutoSave = false;
FocusSelectedLayer.AutoSave = false;
AlwaysApplyDataBindings.AutoSave = false;
@@ -26,7 +26,14 @@
<DockPanel>
<controls:AppBar Type="Dense" Title="{Binding ActiveItem.Plugin.Info.Name}" DockPanel.Dock="Top" Margin="-18 0 0 0" ShowShadow="False">
<controls:AppBar.AppIcon>
<shared:ArtemisIcon Icon="{Binding Icon}"></shared:ArtemisIcon>
<shared:ArtemisIcon Icon="{Binding Plugin.Info.ResolvedIcon}"
Margin="0 5 0 0"
Width="20"
Height="20"
Grid.Row="0"
Grid.RowSpan="3"
HorizontalAlignment="Center"
VerticalAlignment="Top" />
</controls:AppBar.AppIcon>
</controls:AppBar>
@@ -1,4 +1,5 @@
using System;
using Artemis.Core;
using Artemis.UI.Shared;
using Stylet;
@@ -11,10 +12,10 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
public PluginSettingsWindowViewModel(PluginConfigurationViewModel configurationViewModel)
{
_configurationViewModel = configurationViewModel ?? throw new ArgumentNullException(nameof(configurationViewModel));
Icon = configurationViewModel.Plugin.Info.Icon;
Plugin = configurationViewModel.Plugin;
}
public object Icon { get; }
public Plugin Plugin { get; }
protected override void OnInitialActivate()
{
@@ -256,7 +256,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<StackPanel Grid.Row="0" Margin="0 0 0 4">
<TextBlock Style="{StaticResource MaterialDesignSubtitle1TextBlock}">
Activation conditions
</TextBlock>