feat: transfer styles from non-polymorphic configuration

This commit is contained in:
goaaats 2021-10-20 18:00:06 +02:00
parent 913b0f157c
commit e58ebfdfba
No known key found for this signature in database
GPG key ID: F18F057873895461
3 changed files with 21 additions and 1 deletions

View file

@ -70,6 +70,23 @@ namespace Dalamud.Interface.Style
throw new ArgumentException("Was not a compressed style model.");
}
/// <summary>
/// [TEMPORARY] Transfer old non-polymorphic style models to the new format.
/// </summary>
public static void TransferOldModels()
{
var configuration = Service<DalamudConfiguration>.Get();
if (configuration.SavedStylesOld == null)
return;
configuration.SavedStyles = new List<StyleModel>();
configuration.SavedStyles.AddRange(configuration.SavedStylesOld);
configuration.SavedStylesOld = null;
configuration.Save();
}
/// <summary>
/// Serialize this style model.
/// </summary>