Skip to content

Commit

Permalink
📦 2.1.1. Release
Browse files Browse the repository at this point in the history
- Some hotfixes for issues with the asset.
  • Loading branch information
JonathanMCarter committed Jan 20, 2024
1 parent 469b8ef commit f16bafe
Show file tree
Hide file tree
Showing 18 changed files with 134 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ private static void RemoveNullReferences(SerializedObject indexProp)

private static void UpdateIndexReferences(IReadOnlyList<SaveManagerAsset> foundAssets, SerializedObject indexProp)
{
indexProp.Fp("assets").Fpr("list").ClearArray();

for (var i = 0; i < foundAssets.Count; i++)
{
for (var j = 0; j < indexProp.Fp("assets").Fpr("list").arraySize; j++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* THE SOFTWARE.
*/

using System.IO;
using System.Reflection;
using UnityEditor;

namespace CarterGames.Assets.SaveManager.Editor
Expand Down Expand Up @@ -71,7 +73,10 @@ private static void DelayUpdate()
private static void LoadOnProjectOpen()
{
EditorApplication.delayCall -= LoadOnProjectOpen;
SaveManager.Load();

// Initializes the Save Manager and loads the data for use.
typeof(SaveManager).GetMethod("Initialize", BindingFlags.NonPublic | BindingFlags.Static)?.Invoke(null, null);

SessionState.SetBool("HasLoaded", true);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2018-Present Carter Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -38,7 +38,7 @@ public sealed class VersionAutoCheck
/// <summary>
/// The key for the session pref... should be per asset based on the version key to check...
/// </summary>
private static readonly string AutoVersionCheckSessionInitKey = $"CarterGames_{VersionInfo.Key.Trim()}_Editor_Settings_AutoVersionCheckRan";
private static readonly string AutoVersionCheckSessionInitKey = $"{VersionInfo.Key.Trim()}_Editor_Settings_AutoVersionCheckRan";

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Constructors
Expand Down Expand Up @@ -90,4 +90,4 @@ private static void OnVersionCheckResponse()
VersionEditorGUI.ShowResponseDialogue(false);
}
}
}
}

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 @@ -10,11 +10,11 @@
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Expand Down Expand Up @@ -46,7 +46,7 @@ public static class VersionChecker
/// Gets if the latest version is this version.
/// </summary>
public static bool IsLatestVersion => Versions.Data.Match(VersionInfo.ProjectVersionNumber);


/// <summary>
/// Gets if the version here is higher that the latest version.
Expand All @@ -73,7 +73,7 @@ public static class VersionChecker
/// Raises when the data has been downloaded.
/// </summary>
public static Evt ResponseReceived { get; private set; } = new Evt();

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
Expand Down

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
@@ -1,25 +1,25 @@
/*
* Copyright (c) 2018-Present Carter Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
* Copyright (c) 2018-Present Carter Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

using System;
using UnityEngine;
Expand All @@ -30,7 +30,7 @@ namespace CarterGames.Assets.SaveManager.Editor
/// A copy of the Json data for each entry stored on the server.
/// </summary>
[Serializable]
public class VersionData
public sealed class VersionData
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
Expand Down Expand Up @@ -95,7 +95,7 @@ public bool Match(string toCompare)

return aVN.Major.Equals(bVN.Major) && aVN.Minor.Equals(bVN.Minor) && aVN.Patch.Equals(bVN.Patch);
}


/// <summary>
/// Gets if the entry is a higher version than the converted version.
Expand Down

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 @@ -43,10 +43,11 @@ public static void DrawCheckForUpdatesButton()
if (!GUILayout.Button("Check For Updates", GUILayout.MaxWidth(135))) return;

VersionChecker.GetLatestVersions();

VersionChecker.ResponseReceived.AddAnonymous("versionCheckManual", () => ShowResponseDialogue());
}


/// <summary>
/// Shows the response to a version check call as a dialogue box.
/// </summary>
Expand All @@ -55,9 +56,16 @@ public static void ShowResponseDialogue(bool showIfUptoDate = true)
{
VersionChecker.ResponseReceived.RemoveAnonymous("versionCheckManual");

if (!VersionChecker.IsLatestVersion)
if (VersionChecker.IsNewerVersion)
{
if (!showIfUptoDate) return;
EditorUtility.DisplayDialog("Update Checker",
$"You are using a newer version than the currently released one.\n\nYours: {VersionInfo.ProjectVersionNumber}\nLatest: {VersionChecker.LatestVersionNumberString}",
"Continue");
}
else if (!VersionChecker.IsLatestVersion)
{
if (EditorUtility.DisplayDialog($"{VersionInfo.Key} | Update Checker",
if (EditorUtility.DisplayDialog("Update Checker",
$"You are using an older version of this package.\n\nCurrent: {VersionInfo.ProjectVersionNumber}\nLatest: {VersionChecker.LatestVersionNumberString}",
"Latest Release", "Continue"))
{
Expand All @@ -67,8 +75,7 @@ public static void ShowResponseDialogue(bool showIfUptoDate = true)
else
{
if (!showIfUptoDate) return;

EditorUtility.DisplayDialog($"{VersionInfo.Key} | Update Checker",
EditorUtility.DisplayDialog("Update Checker",
"You are using the latest version!",
"Continue");
}
Expand Down

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
@@ -1,25 +1,25 @@
/*
* Copyright (c) 2018-Present Carter Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
* Copyright (c) 2018-Present Carter Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

namespace CarterGames.Assets.SaveManager.Editor
{
Expand All @@ -41,7 +41,7 @@ public static class VersionInfo
/// <summary>
/// The download Url for the latest version of this package.
/// </summary>
public const string DownloadBaseUrl = "https://github.com/CarterGames/SaveManager/releases/tag/";
public const string DownloadBaseUrl = "https://github.com/CarterGames/Common/releases/tag/";


/// <summary>
Expand Down

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
@@ -1,25 +1,25 @@
/*
* Copyright (c) 2018-Present Carter Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
* Copyright (c) 2018-Present Carter Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

using System;
using UnityEngine;
Expand All @@ -30,7 +30,7 @@ namespace CarterGames.Assets.SaveManager.Editor
/// A data class to hold a x.x.x version number for comparisons.
/// </summary>
[Serializable]
public class VersionNumber
public sealed class VersionNumber
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
Expand Down

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

Loading

0 comments on commit f16bafe

Please sign in to comment.