Skip to content

Commit

Permalink
change settings to use .xml extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax committed Jul 6, 2020
1 parent 04431be commit 1e61d71
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Source/Core/Duality/DualityApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ public static SoundDevice Sound
/// <summary>
/// [GET / SET] Provides access to Duality's current <see cref="DualityAppData">application data</see>. This is never null.
/// </summary>
public static SettingsContainer<DualityAppData> AppData { get; } = new SettingsContainer<DualityAppData>("AppData.dat");
public static SettingsContainer<DualityAppData> AppData { get; } = new SettingsContainer<DualityAppData>("AppData.xml");

/// <summary>
/// [GET / SET] Provides access to Duality's current <see cref="DualityUserData">user data</see>. This is never null.
/// </summary>
public static SettingsContainer<DualityUserData> UserData { get; } = new SettingsContainer<DualityUserData>(execContext == ExecutionContext.Editor ? "DefaultUserData.dat" : "UserData.dat");
public static SettingsContainer<DualityUserData> UserData { get; } = new SettingsContainer<DualityUserData>(execContext == ExecutionContext.Editor ? "DefaultUserData.xml" : "UserData.xml");

/// <summary>
/// [GET] Returns the <see cref="ExecutionContext"/> in which this DualityApp is currently running.
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Duality/Utility/SettingsContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public SettingsContainer(string path)
/// </summary>
public void Load()
{
this.Value = Serializer.TryReadObject<TSettings>(this.path) ?? new TSettings();
Changed?.Invoke(this, EventArgs.Empty);
this.Value = Serializer.TryReadObject<TSettings>(this.path, typeof(XmlSerializer)) ?? new TSettings();
this.Changed?.Invoke(this, EventArgs.Empty);
}

/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions Source/DualityTemplates/DualityTemplates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
<None Remove="Templates\SolutionTemplate\Plugins\**" />
</ItemGroup>

<ItemGroup>
<Content Include="Templates\SolutionTemplate\EditorAppData.xml" />
</ItemGroup>

<ItemGroup>
<None Include="Templates\SolutionTemplate\EditorAppData.xml" />
</ItemGroup>

<ItemGroup>
<Content Update="Templates\SolutionTemplate\.template.config\template.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
Expand Down
4 changes: 2 additions & 2 deletions Source/DualityTemplates/Templates/SolutionTemplate/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
# Duality specific files
/Temp
/Backup
/UserData.dat
/DesignTimeData.dat
*.pdb
/*.dll
/*.exe
/*.txt
/*.xml
/Plugins
!AppData.xml
!EditorAppData.xml

# Visual studio specific files
/.vs
2 changes: 1 addition & 1 deletion Source/Editor/DualityEditor/DualityEditorApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static bool IsFirstEditorSession
/// <summary>
/// [GET] Provides access to Duality's current <see cref="EditorAppData">application data</see>. This is never null.
/// </summary>
public static SettingsContainer<EditorAppData> EditorAppData { get; } = new SettingsContainer<EditorAppData>("EditorAppData.dat");
public static SettingsContainer<EditorAppData> EditorAppData { get; } = new SettingsContainer<EditorAppData>("EditorAppData.xml");

public static bool BackupsEnabled
{
Expand Down

0 comments on commit 1e61d71

Please sign in to comment.