mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 06:13:40 +01:00
feat: transfer styles from non-polymorphic configuration
This commit is contained in:
parent
913b0f157c
commit
e58ebfdfba
3 changed files with 21 additions and 1 deletions
|
|
@ -125,7 +125,7 @@ namespace Dalamud
|
|||
|
||||
framework.Enable();
|
||||
|
||||
Log.Information("[T1] Framework ENABLE!");
|
||||
Log.Information("[T1] Load complete!");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -233,6 +233,7 @@ namespace Dalamud
|
|||
Service<DalamudAtkTweaks>.Set().Enable();
|
||||
|
||||
this.IsReady = true;
|
||||
Log.Information("[T2] Load complete!");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -369,6 +369,8 @@ namespace Dalamud.Interface.Internal
|
|||
|
||||
this.SetupFonts();
|
||||
|
||||
StyleModel.TransferOldModels();
|
||||
|
||||
if (configuration.SavedStyles == null || configuration.SavedStyles.All(x => x.Name != StyleModelV1.DalamudStandard.Name))
|
||||
{
|
||||
configuration.SavedStyles = new List<StyleModel> { StyleModelV1.DalamudStandard, StyleModelV1.DalamudClassic };
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue