Properly debug in IPCTester, as much as the current implementation allows.

This commit is contained in:
Cordelia Mist 2025-12-29 17:51:28 -08:00
parent 2b60f204e8
commit 45deebc3c4

View file

@ -71,9 +71,7 @@ public class CollectionsIpcTester : IUiService, IDisposable
IpcTester.DrawIntro("Last Return Code", _returnCode.ToString());
IpcTester.DrawIntro(ResolvedFileChanged.Label, "Last Resolved File Change");
ImGui.TextUnformatted(_lastResolvedFileChangeMod.Length > 0
? $"{_lastResolvedFileChangeType} of {_lastResolvedFileChangeMod} in {_lastResolvedFileChangeCollection} for game path {_lastResolvedFileChangeGamePath} from {_lastResolvedFileChangeOldFilePath} to {_lastResolvedFileChangeNewFilePath}"
: "None");
DrawLastResolvedFileChange();
if (_oldCollection != null)
ImGui.TextUnformatted(!_oldCollection.HasValue ? "Created" : _oldCollection.ToString());
@ -250,6 +248,41 @@ public class CollectionsIpcTester : IUiService, IDisposable
}
}
private void DrawLastResolvedFileChange()
{
if (string.IsNullOrEmpty(_lastResolvedFileChangeMod))
{
ImGui.TextUnformatted("<No Change>");
ImGui.TableNextColumn();
return;
}
ImGui.TextUnformatted(_lastResolvedFileChangeType.ToString());
ImGui.TableNextColumn();
using var font = ImRaii.PushFont(UiBuilder.MonoFont);
ImGui.Selectable("View Details");
if (ImGui.IsItemHovered())
{
using var tt = ImRaii.Tooltip();
using (var t = ImRaii.Table("resolveddetails", 2, ImGuiTableFlags.SizingFixedFit))
{
if (t)
{
ImGuiUtil.DrawTableColumn("Collection");
ImGuiUtil.DrawTableColumn(_lastResolvedFileChangeCollection.ToString());
ImGuiUtil.DrawTableColumn("Mod");
ImGuiUtil.DrawTableColumn(_lastResolvedFileChangeMod);
ImGuiUtil.DrawTableColumn("Game Path");
ImGuiUtil.DrawTableColumn(_lastResolvedFileChangeGamePath);
ImGuiUtil.DrawTableColumn("Old Path");
ImGuiUtil.DrawTableColumn(_lastResolvedFileChangeOldFilePath);
ImGuiUtil.DrawTableColumn("New Path");
ImGuiUtil.DrawTableColumn(_lastResolvedFileChangeNewFilePath);
}
}
}
}
private void UpdateLastResolvedChange(ResolvedFileChange type, Guid collection, string mod, string gamePath, string oldFilePath, string newFilePath)
{
_lastResolvedFileChangeType = type;