From f246fc018de9e4b0b296c391a003dcd24fd88e01 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 1 Jan 2023 16:54:01 +0100 Subject: [PATCH] Fixes for 2df3574cfae9b4fb81c46fe473e9171fcd546245 --- Source/Editor/CustomEditors/Editors/TagEditor.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Editor/CustomEditors/Editors/TagEditor.cs b/Source/Editor/CustomEditors/Editors/TagEditor.cs index 0523904e5..54401cf72 100644 --- a/Source/Editor/CustomEditors/Editors/TagEditor.cs +++ b/Source/Editor/CustomEditors/Editors/TagEditor.cs @@ -114,7 +114,7 @@ namespace FlaxEditor.CustomEditors.Editors private static void GetTags(TreeNode n, PickerData pickerData) { if (n is TreeNodeWithAddons a && a.Addons.Count != 0 && a.Addons[0] is CheckBox c && c.Checked) - pickerData.CachedTags.Add(new Tag((uint)n.Tag)); + pickerData.CachedTags.Add((Tag)n.Tag); foreach (var child in n.Children) { if (child is TreeNode treeNode) @@ -139,7 +139,7 @@ namespace FlaxEditor.CustomEditors.Editors if (pickerData.IsSingle) { UncheckAll(node.ParentTree, node); - var value = new Tag(c.Checked ? (uint)node.Tag : 0); + var value = c.Checked ? (Tag)node.Tag : Tag.Default; pickerData.SetValue?.Invoke(value); pickerData.SetValues?.Invoke(new[] { value }); } @@ -166,8 +166,8 @@ namespace FlaxEditor.CustomEditors.Editors if (parentNode.CustomArrowRect.HasValue) { indentation = (int)((parentNode.CustomArrowRect.Value.Location.X - 18) / nodeIndent) + 1; - var parentIndex = (int)parentNode.Tag; - parentTag = Tags.List[parentIndex]; + var parentTagValue = (Tag)parentNode.Tag; + parentTag = parentTagValue.ToString(); } var node = new TreeNodeWithAddons { @@ -244,7 +244,7 @@ namespace FlaxEditor.CustomEditors.Editors // Add tag var tag = Tags.Get(tagName); node.Text = name; - node.Tag = tag.Index; + node.Tag = tag; var settingsAsset = GameSettings.LoadAsset(); if (settingsAsset && !settingsAsset.WaitForLoaded()) { @@ -297,7 +297,7 @@ namespace FlaxEditor.CustomEditors.Editors // Create node var node = new TreeNodeWithAddons { - Tag = tagValue.Index, + Tag = tagValue, Text = tag, ChildrenIndent = nodeIndent, CullChildren = false,