mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix: save DalamudConfiguration with full type information
This commit is contained in:
parent
6f04f771e9
commit
913b0f157c
1 changed files with 9 additions and 2 deletions
|
|
@ -16,6 +16,13 @@ namespace Dalamud.Configuration.Internal
|
|||
[Serializable]
|
||||
internal sealed class DalamudConfiguration
|
||||
{
|
||||
private static readonly JsonSerializerSettings SerializerSettings = new()
|
||||
{
|
||||
TypeNameHandling = TypeNameHandling.All,
|
||||
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Full,
|
||||
Formatting = Formatting.Indented,
|
||||
};
|
||||
|
||||
[JsonIgnore]
|
||||
private string configPath;
|
||||
|
||||
|
|
@ -238,7 +245,7 @@ namespace Dalamud.Configuration.Internal
|
|||
DalamudConfiguration deserialized;
|
||||
try
|
||||
{
|
||||
deserialized = JsonConvert.DeserializeObject<DalamudConfiguration>(File.ReadAllText(path));
|
||||
deserialized = JsonConvert.DeserializeObject<DalamudConfiguration>(File.ReadAllText(path), SerializerSettings);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -256,7 +263,7 @@ namespace Dalamud.Configuration.Internal
|
|||
/// </summary>
|
||||
public void Save()
|
||||
{
|
||||
File.WriteAllText(this.configPath, JsonConvert.SerializeObject(this, Formatting.Indented));
|
||||
File.WriteAllText(this.configPath, JsonConvert.SerializeObject(this, SerializerSettings));
|
||||
this.DalamudConfigurationSaved?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue