Attempt to have a minute grace whenever collection get removed.

This commit is contained in:
cake
2025-12-21 01:55:26 +01:00
parent 2a670b3e64
commit 7b74fa7c4e
6 changed files with 180 additions and 50 deletions

View File

@@ -1463,7 +1463,10 @@ public class SettingsUi : WindowMediatorSubscriberBase
DrawPairPropertyRow("Has Handler", FormatBool(debugInfo.HasHandler));
DrawPairPropertyRow("Handler Initialized", FormatBool(debugInfo.HandlerInitialized));
DrawPairPropertyRow("Handler Visible", FormatBool(debugInfo.HandlerVisible));
DrawPairPropertyRow("Last Time person rendered in", FormatTimestamp(debugInfo.InvisibleSinceUtc));
DrawPairPropertyRow("Handler Timer Temp Collection removal", FormatCountdown(debugInfo.VisibilityEvictionRemainingSeconds));
DrawPairPropertyRow("Handler Scheduled For Deletion", FormatBool(debugInfo.HandlerScheduledForDeletion));
DrawPairPropertyRow("Note", pair.GetNote() ?? "(none)");
ImGui.EndTable();
}
@@ -1698,6 +1701,19 @@ public class SettingsUi : WindowMediatorSubscriberBase
return value is null ? "n/a" : value.Value.ToLocalTime().ToString("G", CultureInfo.CurrentCulture);
}
private static string? FormatCountdown(double? remainingSeconds)
{
if (!remainingSeconds.HasValue)
return "No";
var secs = Math.Max(0, remainingSeconds.Value);
var t = TimeSpan.FromSeconds(secs);
return t.TotalHours >= 1
? $"{(int)t.TotalHours:00}:{t.Minutes:00}:{t.Seconds:00}"
: $"{(int)t.TotalMinutes:00}:{t.Seconds:00}";
}
private static string FormatBytes(long value) => value < 0 ? "n/a" : UiSharedService.ByteToString(value);
private static string FormatCharacterId(uint id) => id == uint.MaxValue ? "n/a" : $"{id} (0x{id:X8})";