diff --git a/BossMod/Debug/DebugCollision.cs b/BossMod/Debug/DebugCollision.cs index 157bc01d10..173c37d906 100644 --- a/BossMod/Debug/DebugCollision.cs +++ b/BossMod/Debug/DebugCollision.cs @@ -9,7 +9,7 @@ namespace BossMod; -public unsafe class DebugCollision() : IDisposable +public sealed unsafe class DebugCollision() : IDisposable { private readonly UITree _tree = new(); private BitMask _shownLayers = new(1); @@ -46,7 +46,6 @@ private static readonly (int, int)[] _boxEdges = public void Dispose() { - } public void Draw() diff --git a/BossMod/Util/UITree.cs b/BossMod/Util/UITree.cs index 1e48e0f8ed..dd1c25a92a 100644 --- a/BossMod/Util/UITree.cs +++ b/BossMod/Util/UITree.cs @@ -32,8 +32,6 @@ public void Dispose() } } - private uint _selectedID; - // contains 0 elements (if node is closed) or single null (if node is opened) // expected usage is 'foreach (_ in Node(...)) { draw subnodes... }' public IEnumerable Node(string text, bool leaf = false, uint color = 0, Action? contextMenu = null, Action? doubleClick = null, Action? select = null) @@ -84,7 +82,7 @@ private bool RawNode(string text, bool leaf, uint color, Action? contextMenu, Ac { var id = ImGui.GetID(text); var flags = ImGuiTreeNodeFlags.None; - if (id == _selectedID) + if (id == _selectedId) flags |= ImGuiTreeNodeFlags.Selected; if (leaf) flags |= ImGuiTreeNodeFlags.Leaf; @@ -95,7 +93,7 @@ private bool RawNode(string text, bool leaf, uint color, Action? contextMenu, Ac ImGui.PopStyleColor(); if (ImGui.IsItemClicked(ImGuiMouseButton.Left)) { - _selectedID = id; + _selectedId = id; select?.Invoke(); } if (doubleClick != null && ImGui.IsItemHovered() && ImGui.IsMouseDoubleClicked(ImGuiMouseButton.Left))