mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 20:06:33 +00:00
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:
1 parent
4152c290d2
commit
ceeaa4bf6d
164 files changed
+5019
-4220
No files matched your search
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Artemis.Storage.Entities.Module;
|
||||
using Artemis.Storage.Migrations.Interfaces;
|
||||
using LiteDB;
|
||||
|
||||
@@ -87,18 +86,6 @@ namespace Artemis.Storage.Migrations
|
||||
// Remove the default brush the user selected, this will make the UI pick a new one
|
||||
repository.Database.Execute("DELETE PluginSettingEntity WHERE $.Name = \"ProfileEditor.DefaultLayerBrushDescriptor\"");
|
||||
|
||||
// Module settings
|
||||
repository.Database.GetCollection<ModuleSettingsEntity>().DropIndex("PluginGuid");
|
||||
ILiteCollection<BsonDocument> modules = repository.Database.GetCollection("ModuleSettingsEntity");
|
||||
foreach (BsonDocument bsonDocument in modules.FindAll())
|
||||
{
|
||||
if (ReplaceIfFound(bsonDocument, "PluginGuid", "ModuleId", pluginMap))
|
||||
modules.Update(bsonDocument);
|
||||
else if (bsonDocument.ContainsKey("PluginGuid"))
|
||||
modules.Delete(bsonDocument["_id"]);
|
||||
}
|
||||
repository.Database.GetCollection<ModuleSettingsEntity>().EnsureIndex(s => s.ModuleId, true);
|
||||
|
||||
// Profiles
|
||||
ILiteCollection<BsonDocument> collection = repository.Database.GetCollection("ProfileEntity");
|
||||
foreach (BsonDocument bsonDocument in collection.FindAll())
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using System.Linq;
|
||||
using Artemis.Storage.Entities.Profile;
|
||||
using Artemis.Storage.Migrations.Interfaces;
|
||||
using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M0012ProfileCategories : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 12;
|
||||
|
||||
public void Apply(LiteRepository repository)
|
||||
{
|
||||
ILiteCollection<ProfileCategoryEntity> profileCategories = repository.Database.GetCollection<ProfileCategoryEntity>();
|
||||
profileCategories.EnsureIndex(s => s.Name, true);
|
||||
ProfileCategoryEntity? profileCategoryEntity = profileCategories.Find(c => c.Name == "Converted").FirstOrDefault();
|
||||
if (profileCategoryEntity == null)
|
||||
{
|
||||
profileCategoryEntity = new ProfileCategoryEntity {Name = "Imported"};
|
||||
profileCategories.Insert(profileCategoryEntity);
|
||||
}
|
||||
|
||||
ILiteCollection<BsonDocument> collection = repository.Database.GetCollection("ProfileEntity");
|
||||
foreach (BsonDocument bsonDocument in collection.FindAll())
|
||||
{
|
||||
// Profiles with a ModuleId have not been converted
|
||||
if (bsonDocument.ContainsKey("ModuleId"))
|
||||
{
|
||||
string moduleId = bsonDocument["ModuleId"].AsString;
|
||||
bsonDocument.Remove("ModuleId");
|
||||
|
||||
ProfileConfigurationEntity profileConfiguration = new()
|
||||
{
|
||||
Name = bsonDocument["Name"].AsString,
|
||||
MaterialIcon = "ApplicationImport",
|
||||
ModuleId = moduleId,
|
||||
ProfileId = bsonDocument["_id"].AsGuid
|
||||
};
|
||||
|
||||
profileCategoryEntity.ProfileConfigurations.Add(profileConfiguration);
|
||||
collection.Update(bsonDocument);
|
||||
}
|
||||
}
|
||||
|
||||
profileCategories.Update(profileCategoryEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user