mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Only display the file name and last dir for externals
This commit is contained in:
parent
b3379a9710
commit
f3ec4b2e08
1 changed files with 12 additions and 0 deletions
|
|
@ -325,6 +325,18 @@ public class ResourceTreeViewer(
|
||||||
ImGui.SetCursorPosX(textPos);
|
ImGui.SetCursorPosX(textPos);
|
||||||
ImUtf8.Text(resourceNode.ModRelativePath);
|
ImUtf8.Text(resourceNode.ModRelativePath);
|
||||||
}
|
}
|
||||||
|
else if (resourceNode.FullPath.IsRooted)
|
||||||
|
{
|
||||||
|
var path = resourceNode.FullPath.FullName;
|
||||||
|
var lastDirectorySeparator = path.LastIndexOf('\\');
|
||||||
|
var secondLastDirectorySeparator = lastDirectorySeparator > 0
|
||||||
|
? path.LastIndexOf('\\', lastDirectorySeparator - 1)
|
||||||
|
: -1;
|
||||||
|
if (secondLastDirectorySeparator >= 0)
|
||||||
|
path = $"…{path.AsSpan(secondLastDirectorySeparator)}";
|
||||||
|
ImGui.Selectable(path.AsSpan(), false, ImGuiSelectableFlags.AllowItemOverlap,
|
||||||
|
new Vector2(ImGui.GetContentRegionAvail().X, frameHeight));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui.Selectable(resourceNode.FullPath.ToPath(), false, ImGuiSelectableFlags.AllowItemOverlap,
|
ImGui.Selectable(resourceNode.FullPath.ToPath(), false, ImGuiSelectableFlags.AllowItemOverlap,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue