mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 13:57:43 +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();
|
framework.Enable();
|
||||||
|
|
||||||
Log.Information("[T1] Framework ENABLE!");
|
Log.Information("[T1] Load complete!");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -233,6 +233,7 @@ namespace Dalamud
|
||||||
Service<DalamudAtkTweaks>.Set().Enable();
|
Service<DalamudAtkTweaks>.Set().Enable();
|
||||||
|
|
||||||
this.IsReady = true;
|
this.IsReady = true;
|
||||||
|
Log.Information("[T2] Load complete!");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -369,6 +369,8 @@ namespace Dalamud.Interface.Internal
|
||||||
|
|
||||||
this.SetupFonts();
|
this.SetupFonts();
|
||||||
|
|
||||||
|
StyleModel.TransferOldModels();
|
||||||
|
|
||||||
if (configuration.SavedStyles == null || configuration.SavedStyles.All(x => x.Name != StyleModelV1.DalamudStandard.Name))
|
if (configuration.SavedStyles == null || configuration.SavedStyles.All(x => x.Name != StyleModelV1.DalamudStandard.Name))
|
||||||
{
|
{
|
||||||
configuration.SavedStyles = new List<StyleModel> { StyleModelV1.DalamudStandard, StyleModelV1.DalamudClassic };
|
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.");
|
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>
|
/// <summary>
|
||||||
/// Serialize this style model.
|
/// Serialize this style model.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue