feat: add info to browser
This commit is contained in:
parent
d1ae176f29
commit
4aac060cb4
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue