service cleanups, containing logic directly now
This commit is contained in:
@@ -22,13 +22,12 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
||||
private readonly UiSharedService _uiShared;
|
||||
private readonly PairProcessingLimiter _pairProcessingLimiter;
|
||||
private readonly ConcurrentDictionary<GameObjectHandler, bool> _uploadingPlayers = new();
|
||||
private readonly NotificationService _notificationService;
|
||||
private bool _notificationDismissed = true;
|
||||
private int _lastDownloadStateHash = 0;
|
||||
|
||||
public DownloadUi(ILogger<DownloadUi> logger, DalamudUtilService dalamudUtilService, LightlessConfigService configService,
|
||||
PairProcessingLimiter pairProcessingLimiter, FileUploadManager fileTransferManager, LightlessMediator mediator, UiSharedService uiShared,
|
||||
PerformanceCollectorService performanceCollectorService, NotificationService notificationService)
|
||||
PerformanceCollectorService performanceCollectorService)
|
||||
: base(logger, mediator, "Lightless Sync Downloads", performanceCollectorService)
|
||||
{
|
||||
_dalamudUtilService = dalamudUtilService;
|
||||
@@ -36,7 +35,6 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
||||
_pairProcessingLimiter = pairProcessingLimiter;
|
||||
_fileTransferManager = fileTransferManager;
|
||||
_uiShared = uiShared;
|
||||
_notificationService = notificationService;
|
||||
|
||||
SizeConstraints = new WindowSizeConstraints()
|
||||
{
|
||||
@@ -359,7 +357,7 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
||||
_lastDownloadStateHash = currentHash;
|
||||
if (downloadStatus.Count > 0 || queueWaiting > 0)
|
||||
{
|
||||
_notificationService.ShowPairDownloadNotification(downloadStatus, queueWaiting);
|
||||
Mediator.Publish(new PairDownloadStatusMessage(downloadStatus, queueWaiting));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,6 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
private readonly IProgress<(int, int, FileCacheEntity)> _validationProgress;
|
||||
private readonly NameplateService _nameplateService;
|
||||
private readonly NameplateHandler _nameplateHandler;
|
||||
private readonly NotificationService _lightlessNotificationService;
|
||||
private (int, int, FileCacheEntity) _currentProgress;
|
||||
private bool _deleteAccountPopupModalShown = false;
|
||||
private bool _deleteFilesPopupModalShown = false;
|
||||
@@ -107,8 +106,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
IpcManager ipcManager, CacheMonitor cacheMonitor,
|
||||
DalamudUtilService dalamudUtilService, HttpClient httpClient,
|
||||
NameplateService nameplateService,
|
||||
NameplateHandler nameplateHandler,
|
||||
NotificationService lightlessNotificationService) : base(logger, mediator, "Lightless Sync Settings",
|
||||
NameplateHandler nameplateHandler) : base(logger, mediator, "Lightless Sync Settings",
|
||||
performanceCollector)
|
||||
{
|
||||
_configService = configService;
|
||||
@@ -130,7 +128,6 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
_uiShared = uiShared;
|
||||
_nameplateService = nameplateService;
|
||||
_nameplateHandler = nameplateHandler;
|
||||
_lightlessNotificationService = lightlessNotificationService;
|
||||
AllowClickthrough = false;
|
||||
AllowPinning = true;
|
||||
_validationProgress = new Progress<(int, int, FileCacheEntity)>(v => _currentProgress = v);
|
||||
@@ -3616,20 +3613,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
if (ImGui.Button($"{FontAwesomeIcon.Play.ToIconString()}##test_pair", new Vector2(availableWidth, 0)))
|
||||
{
|
||||
_lightlessNotificationService.ShowPairRequestNotification(
|
||||
"Test User",
|
||||
"test-uid-123",
|
||||
() =>
|
||||
{
|
||||
Mediator.Publish(new NotificationMessage("Accepted", "You accepted the test pair request.",
|
||||
NotificationType.Info));
|
||||
},
|
||||
() =>
|
||||
{
|
||||
Mediator.Publish(new NotificationMessage("Declined", "You declined the test pair request.",
|
||||
NotificationType.Info));
|
||||
}
|
||||
);
|
||||
Mediator.Publish(new PairRequestReceivedMessage("test-uid-123", "Test User wants to pair with you."));
|
||||
}
|
||||
}
|
||||
UiSharedService.AttachToolTip("Test pair request notification");
|
||||
@@ -3652,15 +3636,14 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
if (ImGui.Button($"{FontAwesomeIcon.Play.ToIconString()}##test_download", new Vector2(availableWidth, 0)))
|
||||
{
|
||||
_lightlessNotificationService.ShowPairDownloadNotification(
|
||||
new List<(string playerName, float progress, string status)>
|
||||
{
|
||||
Mediator.Publish(new PairDownloadStatusMessage(
|
||||
[
|
||||
("Player One", 0.35f, "downloading"),
|
||||
("Player Two", 0.75f, "downloading"),
|
||||
("Player Three", 1.0f, "downloading")
|
||||
},
|
||||
queueWaiting: 2
|
||||
);
|
||||
],
|
||||
2
|
||||
));
|
||||
}
|
||||
}
|
||||
UiSharedService.AttachToolTip("Test download progress notification");
|
||||
|
||||
Reference in New Issue
Block a user