Skip to content

Commit

Permalink
📦 2.1.3 Release
Browse files Browse the repository at this point in the history
- Fixed an issue where auto load being off would just break saves by forcing it on for now (to use-cases for it being off was very low).
  • Loading branch information
JonathanMCarter committed Feb 8, 2024
1 parent 4b3eac7 commit ccf2134
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ private void DrawOptionsSettings()
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(serializedObject.Fp("encryptionOption"), new GUIContent("Encryption Option"));
EditorGUILayout.PropertyField(serializedObject.Fp("prettify"));
EditorGUILayout.PropertyField(serializedObject.Fp("autoLoadOnEntry"));
EditorGUILayout.PropertyField(serializedObject.Fp("autoSaveOnExit"));
EditorGUILayout.PropertyField(serializedObject.Fp("showLogs"));
EditorGUI.EndDisabledGroup();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public static class SaveManagerSettingsProvider

private static readonly GUIContent EncryptionOption = new GUIContent("Encryption Option", "Sets which encryption setting the save will use.");
private static readonly GUIContent PrettyFormat = new GUIContent("Pretty Save Formatting?","Formats the save file into a more readable format when saving.");
private static readonly GUIContent AutoLoad = new GUIContent("Auto Load?","Defines if the game loads on play/entering the game.");
private static readonly GUIContent AutoSave = new GUIContent("Auto Save?","Defines if the game saves when exiting the game.");
private static readonly GUIContent SaveKeysToggle = new GUIContent("Show Save Keys?","Defines if the save editor shows the save key for each save value, Use this to condense the UI a tad if you need to.");
private static readonly GUIContent Logs = new GUIContent("Show Log Messages?", "Shows log messages for any errors as well as some handy debugging information.");
Expand Down Expand Up @@ -294,8 +293,7 @@ private static void DrawGeneralOptions()
EditorGUI.BeginDisabledGroup(SettingsAssetObject.Fp("encryptionOption").enumValueIndex.Equals(1));
EditorGUILayout.PropertyField(SettingsAssetObject.Fp("prettify"),PrettyFormat);
EditorGUI.EndDisabledGroup();

EditorGUILayout.PropertyField(SettingsAssetObject.Fp("autoLoadOnEntry"),AutoLoad);

EditorGUILayout.PropertyField(SettingsAssetObject.Fp("autoSaveOnExit"),AutoSave);

EditorGUILayout.EndVertical();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static class AssetVersionData
/// <summary>
/// The version number of the asset.
/// </summary>
public static string VersionNumber => "2.1.2";
public static string VersionNumber => "2.1.3";


/// <summary>
Expand All @@ -40,6 +40,6 @@ public static class AssetVersionData
/// <remarks>
/// Asset owner is in the UK, so its D/M/Y format.
/// </remarks>
public static string ReleaseDate => "20/01/2024";
public static string ReleaseDate => "08/02/2024";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public sealed class SettingsAssetRuntime : SaveManagerAsset

[SerializeField] private EncryptionOption encryptionOption;
[SerializeField] private bool prettify;
[SerializeField] private bool autoLoadOnEntry = true;
[SerializeField] private bool autoSaveOnExit = true;

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -110,7 +109,10 @@ public SaveData SaveData
/// </summary>
public bool Prettify => prettify;

public bool AutoLoad => autoLoadOnEntry;

/// <summary>
/// Defines if the asset auto saves changes.
/// </summary>
public bool AutoSave => autoSaveOnExit;

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
Expand Down
20 changes: 2 additions & 18 deletions Carter Games/Save Manager/Code/Runtime/SaveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,7 @@ private static void Initialize()

TryGenerateSaveLookup();


if (SaveData != null)
{
if (AssetAccessor.GetAsset<SettingsAssetRuntime>().AutoLoad)
{
LoadedDataLookup = LoadFromFile();
}
else
{
LoadedDataLookup = new SerializableDictionary<string, SerializableDictionary<string, string>>();
}
}
else
{
LoadedDataLookup = new SerializableDictionary<string, SerializableDictionary<string, string>>();
}

LoadedDataLookup = LoadFromFile();

foreach (var saveValue in SaveDataLookup.ToList())
{
Expand Down Expand Up @@ -298,7 +282,7 @@ private static SerializableDictionary<string, SerializableDictionary<string, str
loadHandler = new WebSaveHandler();
#else
loadHandler = new StandardSaveHandler();
#endif
#endif

return loadHandler.LoadFromFile(SavePath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public SerializableDictionary<string, SerializableDictionary<string, string>> Lo
stream.Close();
}


var dic = new SerializableDictionary<string, SerializableDictionary<string, string>>();

foreach (var kpair in jsonData)
Expand Down
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ccf2134

Please sign in to comment.