From 5003b1fb77e1098b7c5bbc89578a7fb38683ff53 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 7 May 2024 08:10:11 +0100 Subject: [PATCH] :package: 2.1.6 Release - Fixed that editor issue where the GUI wouldn't update when copy/pasting values into save values in the save editor. --- .../Inspectors/SaveObjectEditor.cs | 8 +------- .../Editor Window/Sub Windows/EditorTab.cs | 19 ++++++++++++++++--- .../Code/Editor/Utility/AssetVersionData.cs | 4 ++-- .../Encryption/Data/EncryptionOption.cs | 2 +- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Carter Games/Save Manager/Code/Editor/Custom Editors/Inspectors/SaveObjectEditor.cs b/Carter Games/Save Manager/Code/Editor/Custom Editors/Inspectors/SaveObjectEditor.cs index a3e222d..ea5234c 100644 --- a/Carter Games/Save Manager/Code/Editor/Custom Editors/Inspectors/SaveObjectEditor.cs +++ b/Carter Games/Save Manager/Code/Editor/Custom Editors/Inspectors/SaveObjectEditor.cs @@ -72,7 +72,6 @@ public void EditorWindowGUI() DrawInfoSection(); EditorGUILayout.Space(3.5f); - DrawValuesSection(); // Applies changes only if there are changes made. @@ -96,10 +95,6 @@ public override void OnInspectorGUI() EditorGUILayout.Space(3.5f); InspectorDrawValues(); - // Applies changes only if there are changes made. - if (!EditorGUI.EndChangeCheck()) return; - - serializedObject.ApplyModifiedProperties(); serializedObject.Update(); } @@ -193,7 +188,7 @@ private void DrawValuesSection() UtilEditor.DrawHorizontalGUILine(); var prop = serializedObject.GetIterator(); - + if (prop.NextVisible(true)) { while (prop.NextVisible(false)) @@ -234,7 +229,6 @@ private void InspectorDrawValues() EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(serializedObject.Fp(prop.name).Fpr("value"), new GUIContent(prop.displayName), true); EditorGUI.indentLevel--; diff --git a/Carter Games/Save Manager/Code/Editor/Custom Editors/Windows/Editor Window/Sub Windows/EditorTab.cs b/Carter Games/Save Manager/Code/Editor/Custom Editors/Windows/Editor Window/Sub Windows/EditorTab.cs index c9f313e..018c4a4 100644 --- a/Carter Games/Save Manager/Code/Editor/Custom Editors/Windows/Editor Window/Sub Windows/EditorTab.cs +++ b/Carter Games/Save Manager/Code/Editor/Custom Editors/Windows/Editor Window/Sub Windows/EditorTab.cs @@ -68,7 +68,7 @@ public void DrawTab(List saveObjects) PerUserSettings.SaveEditorTabScrollRectPos = EditorGUILayout.BeginScrollView(PerUserSettings.SaveEditorTabScrollRectPos); - + foreach (var saveObj in saveObjects) { SerializedObject sObj; @@ -95,8 +95,13 @@ public void DrawTab(List saveObjects) EditorGUILayout.Space(5f); EditorGUILayout.EndScrollView(); - - // UtilEditor.CreateDeselectZone(ref deselectRect); + + // Force update all elements... + foreach (var lookup in editorsLookup) + { + lookup.Value.serializedObject.ApplyModifiedProperties(); + lookup.Value.serializedObject.Update(); + } } @@ -229,7 +234,15 @@ private void DrawSaveObjectEditor(SaveObject targetSaveObject) if (editorsLookup[targetSaveObject].serializedObject.Fp("isExpanded").boolValue) { + EditorGUI.BeginChangeCheck(); editorsLookup[targetSaveObject].EditorWindowGUI(); + + if (EditorGUI.EndChangeCheck()) + { + editorsLookup[targetSaveObject].serializedObject.ApplyModifiedProperties(); + editorsLookup[targetSaveObject].serializedObject.Update(); + } + GUILayout.Space(1.5f); } diff --git a/Carter Games/Save Manager/Code/Editor/Utility/AssetVersionData.cs b/Carter Games/Save Manager/Code/Editor/Utility/AssetVersionData.cs index a9eafc0..c6264ff 100644 --- a/Carter Games/Save Manager/Code/Editor/Utility/AssetVersionData.cs +++ b/Carter Games/Save Manager/Code/Editor/Utility/AssetVersionData.cs @@ -31,7 +31,7 @@ public static class AssetVersionData /// /// The version number of the asset. /// - public static string VersionNumber => "2.1.5"; + public static string VersionNumber => "2.1.6"; /// @@ -40,6 +40,6 @@ public static class AssetVersionData /// /// Asset owner is in the UK, so its D/M/Y format. /// - public static string ReleaseDate => "17/04/2024"; + public static string ReleaseDate => "07/05/2024"; } } \ No newline at end of file diff --git a/Carter Games/Save Manager/Code/Runtime/Saving/Encryption/Data/EncryptionOption.cs b/Carter Games/Save Manager/Code/Runtime/Saving/Encryption/Data/EncryptionOption.cs index c5004f5..5419d0c 100644 --- a/Carter Games/Save Manager/Code/Runtime/Saving/Encryption/Data/EncryptionOption.cs +++ b/Carter Games/Save Manager/Code/Runtime/Saving/Encryption/Data/EncryptionOption.cs @@ -33,7 +33,7 @@ public enum EncryptionOption /// /// Doesn't use encryption & the save data will be saved in plain JSON text. /// - [InspectorName("Disabled (Not Recommended | Debug)")] Disabled, + [InspectorName("Disabled (Plain Text)")] Disabled, ///