feat: add info to browser

This commit is contained in:
Anna 2024-02-18 15:10:21 -05:00
parent d1ae176f29
commit 4aac060cb4
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 36 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System.Data;
using System.Diagnostics;
using System.Numerics;
using Dalamud.Interface;
using Dalamud.Interface.Components;
@ -135,7 +136,9 @@ internal class DatabaseTab : ITab {
foreach (var grouping in grouped) {
var label = grouping.Key;
// FIXME: label should be unique (pushid?)
ImGui.PushID($"{Enum.GetName(groupBy.Value)}-{label}");
using var popId = new OnDispose(ImGui.PopID);
if (!ImGui.TreeNodeEx(label)) {
continue;
}
@ -157,7 +160,38 @@ internal class DatabaseTab : ITab {
}
private void DrawShot(SavedMetadata shot) {
ImGui.TextUnformatted(shot.Path);
var fileName = Path.GetFileName(shot.Path);
if (!ImGui.TreeNodeEx($"{fileName}##shot-{shot.Path}-{shot.Blake3Hash}")) {
return;
}
using var treePop = new OnDispose(ImGui.TreePop);
if (ImGui.Button("Open", new Vector2(ImGui.GetContentRegionAvail().X, 0))) {
Process.Start(new ProcessStartInfo(shot.Path) {
UseShellExecute = true,
});
}
if (ImGui.CollapsingHeader("Players visible in shot")) {
if (shot.Metadata.VisibleCharacters.Length == 0) {
ImGui.TextUnformatted("None");
}
foreach (var chara in shot.Metadata.VisibleCharacters) {
ImGui.TextUnformatted($"{chara.Name} ({chara.HomeWorld})");
}
}
if (ImGui.CollapsingHeader("Mods visible in shot")) {
if (shot.Metadata.ModsInUse.Length == 0) {
ImGui.TextUnformatted("None");
}
foreach (var mod in shot.Metadata.ModsInUse) {
ImGui.TextUnformatted(mod.Name);
}
}
}
private void Update() {