From 6f657c4a710082ceb7b8480699b637091143b696 Mon Sep 17 00:00:00 2001 From: Anders Ejlersen Date: Mon, 25 Nov 2024 22:10:25 +0100 Subject: [PATCH] 1.10.1: Fixed issue, where scene picker settings wouldn't save, if removing a group element --- CHANGELOG.md | 11 +++++++++++ .../Settings/ToolbarScenePickerProjectSettings.cs | 8 ++++---- Editor/Toolbar/Tools/ToolScenePicker.cs | 1 - ...ListDrawer.cs => AbstractReorderableListDrawer.cs} | 9 +++++---- ....cs.meta => AbstractReorderableListDrawer.cs.meta} | 0 ...stDrawer.cs => SceneGroupReorderableListDrawer.cs} | 10 +++++----- ...s.meta => SceneGroupReorderableListDrawer.cs.meta} | 0 ...leListDrawer.cs => StringReorderableListDrawer.cs} | 4 ++-- ...er.cs.meta => StringReorderableListDrawer.cs.meta} | 0 package.json | 2 +- 10 files changed, 28 insertions(+), 17 deletions(-) rename Editor/Toolbar/Utilities/ReordableList/{AbstractReordableListDrawer.cs => AbstractReorderableListDrawer.cs} (86%) rename Editor/Toolbar/Utilities/ReordableList/{AbstractReordableListDrawer.cs.meta => AbstractReorderableListDrawer.cs.meta} (100%) rename Editor/Toolbar/Utilities/ReordableList/{SceneGroupReordableListDrawer.cs => SceneGroupReorderableListDrawer.cs} (85%) rename Editor/Toolbar/Utilities/ReordableList/{SceneGroupReordableListDrawer.cs.meta => SceneGroupReorderableListDrawer.cs.meta} (100%) rename Editor/Toolbar/Utilities/ReordableList/{StringReordableListDrawer.cs => StringReorderableListDrawer.cs} (81%) rename Editor/Toolbar/Utilities/ReordableList/{StringReordableListDrawer.cs.meta => StringReorderableListDrawer.cs.meta} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7257d56..aa4bf21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. +## [1.10.1] - 2024-11-25 + +### Fixed +- Fixed issue, where scene picker settings wouldn't save, if removing a group element + +## [1.10.0] - 2024-11-17 + +### Added +- Added samples for burst and entities + + ## [1.9.5] - 2024-07-18 ### Fixed diff --git a/Editor/Toolbar/Tools/Settings/ToolbarScenePickerProjectSettings.cs b/Editor/Toolbar/Tools/Settings/ToolbarScenePickerProjectSettings.cs index 5336768..e503fdf 100644 --- a/Editor/Toolbar/Tools/Settings/ToolbarScenePickerProjectSettings.cs +++ b/Editor/Toolbar/Tools/Settings/ToolbarScenePickerProjectSettings.cs @@ -8,8 +8,8 @@ namespace Module.NavigationTool.Editor.Toolbar public string Title => "Scene"; public bool IsSettingsDirty { get; private set; } - private StringReordableListDrawer assetLabelList; - private SceneGroupReordableListDrawer sceneGroupList; + private StringReorderableListDrawer assetLabelList; + private SceneGroupReorderableListDrawer sceneGroupList; private ToolbarProjectSettings projectSettings; private Settings settings; @@ -19,10 +19,10 @@ namespace Module.NavigationTool.Editor.Toolbar this.projectSettings = projectSettings; settings = projectSettings.GetValueAs(); - assetLabelList = new StringReordableListDrawer(settings.labels, "Scene sorting by Asset label"); + assetLabelList = new StringReorderableListDrawer(settings.labels, "Scene sorting by Asset label"); assetLabelList.onChanged += ToolScenePicker.SetAsDirty; - sceneGroupList = new SceneGroupReordableListDrawer(settings.sceneGroups.groups, "Scene groups"); + sceneGroupList = new SceneGroupReorderableListDrawer(settings.sceneGroups.groups, "Scene groups"); sceneGroupList.onChanged += ToolScenePicker.SetAsDirty; } diff --git a/Editor/Toolbar/Tools/ToolScenePicker.cs b/Editor/Toolbar/Tools/ToolScenePicker.cs index ae78142..d3f441d 100644 --- a/Editor/Toolbar/Tools/ToolScenePicker.cs +++ b/Editor/Toolbar/Tools/ToolScenePicker.cs @@ -223,7 +223,6 @@ namespace Module.NavigationTool.Editor.Toolbar public static readonly GUIContent LABEL_SCENE_SINGLE = new GUIContent(string.Empty, "Single scene loading (toggle to Additive)"); #endif - public static readonly GUIContent LABEL_SCENE_CREATE = new GUIContent(string.Empty, "Create a new scene"); public const float BUTTON_WIDTH = 24.0f; } diff --git a/Editor/Toolbar/Utilities/ReordableList/AbstractReordableListDrawer.cs b/Editor/Toolbar/Utilities/ReordableList/AbstractReorderableListDrawer.cs similarity index 86% rename from Editor/Toolbar/Utilities/ReordableList/AbstractReordableListDrawer.cs rename to Editor/Toolbar/Utilities/ReordableList/AbstractReorderableListDrawer.cs index e9b9254..2f29afa 100644 --- a/Editor/Toolbar/Utilities/ReordableList/AbstractReordableListDrawer.cs +++ b/Editor/Toolbar/Utilities/ReordableList/AbstractReorderableListDrawer.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace Module.NavigationTool.Editor.Toolbar { - internal abstract class AbstractReordableListDrawer + internal abstract class AbstractReorderableListDrawer { public readonly List list; @@ -15,11 +15,11 @@ namespace Module.NavigationTool.Editor.Toolbar public bool IsDirty { get; private set; } - protected AbstractReordableListDrawer(List list, string header) + protected AbstractReorderableListDrawer(List list, string header) { this.list = list; - reorderableList = new ReorderableList(list, typeof(string), true, true, true, true); + reorderableList = new ReorderableList(this.list, typeof(T), true, true, true, true); reorderableList.drawElementCallback += (rect, index, isActive, isFocused) => { EditorGUI.BeginChangeCheck(); @@ -36,7 +36,7 @@ namespace Module.NavigationTool.Editor.Toolbar }; reorderableList.onRemoveCallback += rl => { - list.RemoveAt(rl.index); + this.list.RemoveAt(rl.index); OnRemovedElementFromList(rl.index); InvokeChanged(); }; @@ -70,6 +70,7 @@ namespace Module.NavigationTool.Editor.Toolbar protected void InvokeChanged() { + IsDirty = true; onChanged?.Invoke(); } } diff --git a/Editor/Toolbar/Utilities/ReordableList/AbstractReordableListDrawer.cs.meta b/Editor/Toolbar/Utilities/ReordableList/AbstractReorderableListDrawer.cs.meta similarity index 100% rename from Editor/Toolbar/Utilities/ReordableList/AbstractReordableListDrawer.cs.meta rename to Editor/Toolbar/Utilities/ReordableList/AbstractReorderableListDrawer.cs.meta diff --git a/Editor/Toolbar/Utilities/ReordableList/SceneGroupReordableListDrawer.cs b/Editor/Toolbar/Utilities/ReordableList/SceneGroupReorderableListDrawer.cs similarity index 85% rename from Editor/Toolbar/Utilities/ReordableList/SceneGroupReordableListDrawer.cs rename to Editor/Toolbar/Utilities/ReordableList/SceneGroupReorderableListDrawer.cs index 072375e..9e2e68d 100644 --- a/Editor/Toolbar/Utilities/ReordableList/SceneGroupReordableListDrawer.cs +++ b/Editor/Toolbar/Utilities/ReordableList/SceneGroupReorderableListDrawer.cs @@ -4,16 +4,16 @@ using UnityEngine; namespace Module.NavigationTool.Editor.Toolbar { - internal sealed class SceneGroupReordableListDrawer : AbstractReordableListDrawer + internal sealed class SceneGroupReorderableListDrawer : AbstractReorderableListDrawer { - private readonly List elements = new List(); + private readonly List elements = new List(); - public SceneGroupReordableListDrawer(List list, string header) + public SceneGroupReorderableListDrawer(List list, string header) : base(list, header) { for (var i = 0; i < list.Count; i++) { - elements.Add(new StringReordableListDrawer(list[i].filters, "Filters")); + elements.Add(new StringReorderableListDrawer(list[i].filters, "Filters")); } } @@ -61,7 +61,7 @@ namespace Module.NavigationTool.Editor.Toolbar filters = filters }); - elements.Add(new StringReordableListDrawer(filters, "Filters")); + elements.Add(new StringReorderableListDrawer(filters, "Filters")); } protected override void OnRemovedElementFromList(int index) diff --git a/Editor/Toolbar/Utilities/ReordableList/SceneGroupReordableListDrawer.cs.meta b/Editor/Toolbar/Utilities/ReordableList/SceneGroupReorderableListDrawer.cs.meta similarity index 100% rename from Editor/Toolbar/Utilities/ReordableList/SceneGroupReordableListDrawer.cs.meta rename to Editor/Toolbar/Utilities/ReordableList/SceneGroupReorderableListDrawer.cs.meta diff --git a/Editor/Toolbar/Utilities/ReordableList/StringReordableListDrawer.cs b/Editor/Toolbar/Utilities/ReordableList/StringReorderableListDrawer.cs similarity index 81% rename from Editor/Toolbar/Utilities/ReordableList/StringReordableListDrawer.cs rename to Editor/Toolbar/Utilities/ReordableList/StringReorderableListDrawer.cs index 1bba6f5..07283f6 100644 --- a/Editor/Toolbar/Utilities/ReordableList/StringReordableListDrawer.cs +++ b/Editor/Toolbar/Utilities/ReordableList/StringReorderableListDrawer.cs @@ -5,9 +5,9 @@ using UnityEngine; namespace Module.NavigationTool.Editor.Toolbar { - internal sealed class StringReordableListDrawer : AbstractReordableListDrawer + internal sealed class StringReorderableListDrawer : AbstractReorderableListDrawer { - public StringReordableListDrawer(List list, string header) + public StringReorderableListDrawer(List list, string header) : base(list, header) { } diff --git a/Editor/Toolbar/Utilities/ReordableList/StringReordableListDrawer.cs.meta b/Editor/Toolbar/Utilities/ReordableList/StringReorderableListDrawer.cs.meta similarity index 100% rename from Editor/Toolbar/Utilities/ReordableList/StringReordableListDrawer.cs.meta rename to Editor/Toolbar/Utilities/ReordableList/StringReorderableListDrawer.cs.meta diff --git a/package.json b/package.json index bbda93e..a3c5dc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.module.navigationtool", - "version": "1.10.0", + "version": "1.10.1", "displayName": "Module.NavigationTool", "description": "Support for navigation tools, like favorites, history and toolbars", "unity": "2019.2",