Skip to content

Commit

Permalink
fix wad file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Crauzer committed Mar 29, 2023
1 parent 47569d9 commit ba67114
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Obsidian/Data/Wad/IWadTreePathable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public interface IWadTreePathable

string Name { get; }
string Path { get; }

public bool IsWadArchive { get; }
}

public static class IWadTreePathableExtensions
Expand Down
2 changes: 1 addition & 1 deletion Obsidian/Data/Wad/WadTreeItemModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public WadTreeItemModel(IWadTreePathable parent, string name)

this.Path = parent switch
{
null or WadTreeModel => name,
null or WadTreeModel or { IsWadArchive: true } => name,
_ => string.Join('/', parent.Path, name)
};
}
Expand Down
1 change: 1 addition & 0 deletions Obsidian/Data/Wad/WadTreeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class WadTreeModel : IWadTreeParent, IDisposable
public int Depth => 0;
public string Name => string.Empty;
public string Path => string.Empty;
public bool IsWadArchive => false;

public bool UseRegexFilter { get; set; }
public string Filter { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions Obsidian/Shared/TreeWadItem.razor
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
<MudText Typo="Typo.subtitle2">Save</MudText>
</MudMenuItem>
}
@if (this.Item.IsWadArchive)
{
<MudMenuItem Icon="@Icons.Material.TwoTone.Delete" IconSize="Size.Small" IconColor="Color.Primary"
OnClick="@Delete">
<MudText Typo="Typo.subtitle2">Delete</MudText>
</MudMenuItem>
}
<MudDivider />
<MudMenuItem Icon="@Icons.Material.TwoTone.Code" IconSize="Size.Small" IconColor="Color.Primary">
<MudTooltip Delay="150" Placement="Placement.Right" Color="Color.Dark">
Expand Down

0 comments on commit ba67114

Please sign in to comment.