notif overlay flex with 1 sec delay removal
This commit is contained in:
@@ -25,8 +25,6 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
||||
private readonly NotificationService _notificationService;
|
||||
private bool _notificationDismissed = true;
|
||||
private int _lastDownloadStateHash = 0;
|
||||
private DateTime _lastNotificationUpdate = DateTime.MinValue;
|
||||
private const int MinUpdateIntervalMs = 1000;
|
||||
|
||||
public DownloadUi(ILogger<DownloadUi> logger, DalamudUtilService dalamudUtilService, LightlessConfigService configService,
|
||||
PairProcessingLimiter pairProcessingLimiter, FileUploadManager fileTransferManager, LightlessMediator mediator, UiSharedService uiShared,
|
||||
@@ -142,7 +140,6 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
||||
_notificationService.DismissPairDownloadNotification();
|
||||
_notificationDismissed = true;
|
||||
_lastDownloadStateHash = 0;
|
||||
_lastNotificationUpdate = DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -354,14 +351,11 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
||||
hashCode.Add(queueWaiting);
|
||||
|
||||
var currentHash = hashCode.ToHashCode();
|
||||
var now = DateTime.UtcNow;
|
||||
var timeSinceLastUpdate = (now - _lastNotificationUpdate).TotalMilliseconds;
|
||||
|
||||
// Only update notification if state has changed AND at least 1 second has passed
|
||||
if (currentHash != _lastDownloadStateHash && timeSinceLastUpdate >= MinUpdateIntervalMs)
|
||||
// Only update notification if state has actually changed
|
||||
if (currentHash != _lastDownloadStateHash)
|
||||
{
|
||||
_lastDownloadStateHash = currentHash;
|
||||
_lastNotificationUpdate = now;
|
||||
if (downloadStatus.Count > 0 || queueWaiting > 0)
|
||||
{
|
||||
_notificationService.ShowPairDownloadNotification(downloadStatus, queueWaiting);
|
||||
|
||||
@@ -134,11 +134,7 @@ public class LightlessNotificationUI : WindowMediatorSubscriberBase
|
||||
|
||||
var viewport = ImGui.GetMainViewport();
|
||||
|
||||
// Set window to full viewport height
|
||||
var width = _configService.Current.NotificationWidth;
|
||||
Size = new Vector2(width, viewport.WorkSize.Y);
|
||||
SizeCondition = ImGuiCond.Always;
|
||||
|
||||
// Window auto-resizes based on content (AlwaysAutoResize flag)
|
||||
Position = CalculateWindowPosition(viewport);
|
||||
PositionCondition = ImGuiCond.Always;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user