Skip to content

Commit

Permalink
fix code analyzer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CarnifexOptimus committed Dec 28, 2024
1 parent d2f17fb commit f3d5b34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions BossMod/Debug/DebugCollision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -46,7 +46,6 @@ private static readonly (int, int)[] _boxEdges =

public void Dispose()
{

}

public void Draw()
Expand Down
6 changes: 2 additions & 4 deletions BossMod/Util/UITree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<object?> Node(string text, bool leaf = false, uint color = 0, Action? contextMenu = null, Action? doubleClick = null, Action? select = null)
Expand Down Expand Up @@ -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;
Expand All @@ -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))
Expand Down

0 comments on commit f3d5b34

Please sign in to comment.