Profiles - Reworked profile system

Sidebar - Redesigned sidebar with customizable categories
Profiles - Added the ability to configure custom profile icons
Profiles - Added the ability to activate multiple profiles for modules at once
Profiles - Added the ability to create profiles for no modules
Profiles - Added the ability to suspend a profile or an entire category
Profiles - Added profile activation conditions
Profiles - Added file-based importing/exporting
Profile editor - Condensed UI, removed tabs 
Profile editor - Disable condition operators until a left-side is picked
This commit is contained in:
Robert Beekman authored and GitHub committed 2021-06-03 22:34:43 +02:00
1 parent 4152c290d2
commit ceeaa4bf6d
164 files changed
+5019 -4220

No files matched your search

@@ -96,7 +96,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs
/// <inheritdoc />
protected override void OnClose()
{
_profileEditorService.UpdateSelectedProfileElement();
_profileEditorService.SaveSelectedProfileElement();
base.OnClose();
}
@@ -59,13 +59,13 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
{
_updatingTree = true;
ProfileElement firstChild = _profileEditorService.SelectedProfile?.Children?.FirstOrDefault();
if (!(firstChild is Folder folder))
if (firstChild is not Folder folder)
{
ActivateItem(null);
return;
}
ActivateItem(_profileTreeVmFactory.FolderViewModel(folder));
ActiveItem = _profileTreeVmFactory.FolderViewModel(folder);
_updatingTree = false;
}
@@ -141,7 +141,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
}
Unsubscribe();
_profileEditorService.UpdateSelectedProfile();
_profileEditorService.SaveSelectedProfileConfiguration();
Subscribe();
}
@@ -177,17 +177,17 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
private void Subscribe()
{
_profileEditorService.ProfileSelected += OnProfileSelected;
_profileEditorService.ProfileElementSelected += OnProfileElementSelected;
_profileEditorService.SelectedProfileChanged += OnSelectedProfileChanged;
_profileEditorService.SelectedProfileElementChanged += OnSelectedProfileElementChanged;
}
private void Unsubscribe()
{
_profileEditorService.ProfileSelected -= OnProfileSelected;
_profileEditorService.ProfileElementSelected -= OnProfileElementSelected;
_profileEditorService.SelectedProfileChanged -= OnSelectedProfileChanged;
_profileEditorService.SelectedProfileElementChanged -= OnSelectedProfileElementChanged;
}
private void OnProfileElementSelected(object sender, RenderProfileElementEventArgs e)
private void OnSelectedProfileElementChanged(object sender, RenderProfileElementEventArgs e)
{
if (e.RenderProfileElement == SelectedTreeItem?.ProfileElement)
return;
@@ -213,7 +213,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
}
}
private void OnProfileSelected(object sender, EventArgs e)
private void OnSelectedProfileChanged(object sender, EventArgs e)
{
CreateRootFolderViewModel();
}
@@ -129,7 +129,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
throw new ArtemisUIException("Cannot add a folder to a profile element of type " + ProfileElement.GetType().Name);
Folder _ = new(ProfileElement, "New folder");
_profileEditorService.UpdateSelectedProfile();
_profileEditorService.SaveSelectedProfileConfiguration();
}
public void AddLayer()
@@ -145,7 +145,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
layer.ChangeLayerBrush(brush);
layer.AddLeds(_rgbService.EnabledDevices.SelectMany(d => d.Leds));
_profileEditorService.UpdateSelectedProfile();
_profileEditorService.SaveSelectedProfileConfiguration();
_profileEditorService.ChangeSelectedProfileElement(layer);
}
@@ -163,7 +163,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
if (result is string newName)
{
ProfileElement.Name = newName;
_profileEditorService.UpdateSelectedProfile();
_profileEditorService.SaveSelectedProfileConfiguration();
}
}
@@ -189,7 +189,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
ProfileElement.Parent?.RemoveChild(ProfileElement);
parent.RemoveExistingElement(this);
_profileEditorService.UpdateSelectedProfile();
_profileEditorService.SaveSelectedProfileConfiguration();
_profileEditorService.ChangeSelectedProfileElement(newSelection as RenderProfileElement);
}
@@ -243,7 +243,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
public void SuspendedToggled()
{
_profileEditorService.UpdateSelectedProfile();
_profileEditorService.SaveSelectedProfileConfiguration();
}
public void ContextMenuOpening(object sender, EventArgs e)