pair/downloads notif changes + more settings options

This commit is contained in:
choco
2025-10-09 13:56:40 +02:00
parent 0dfa667ed3
commit d295f3e22d
6 changed files with 74 additions and 37 deletions

View File

@@ -1,6 +1,7 @@
using Dalamud.Bindings.ImGui;
using Dalamud.Interface.Colors;
using LightlessSync.LightlessConfiguration;
using LightlessSync.LightlessConfiguration.Models;
using LightlessSync.PlayerData.Handlers;
using LightlessSync.Services;
using LightlessSync.Services.Mediator;
@@ -120,9 +121,14 @@ public class DownloadUi : WindowMediatorSubscriberBase
try
{
if (_configService.Current.UseNotificationsForDownloads)
// Check if download notifications are enabled (not set to TextOverlay)
var useNotifications = _configService.Current.UseLightlessNotifications
? _configService.Current.LightlessDownloadNotification != NotificationLocation.TextOverlay
: _configService.Current.UseNotificationsForDownloads;
if (useNotifications)
{
// Use new notification stuff
// Use notification system
if (_currentDownloads.Any())
{
UpdateDownloadNotification(limiterSnapshot);
@@ -132,7 +138,8 @@ public class DownloadUi : WindowMediatorSubscriberBase
{
_notificationService.DismissPairDownloadNotification();
_notificationDismissed = true;
} }
}
}
else
{
if (limiterSnapshot.IsEnabled)

View File

@@ -527,6 +527,8 @@ public class LightlessNotificationUI : WindowMediatorSubscriberBase
NotificationType.Info => UIColors.Get("LightlessPurple"),
NotificationType.Warning => UIColors.Get("LightlessYellow"),
NotificationType.Error => UIColors.Get("DimRed"),
NotificationType.PairRequest => UIColors.Get("LightlessBlue"),
NotificationType.Download => UIColors.Get("LightlessGreen"),
_ => UIColors.Get("LightlessPurple")
};
}

View File

@@ -2675,6 +2675,30 @@ public class SettingsUi : WindowMediatorSubscriberBase
_configService.Save();
}, _configService.Current.LightlessErrorNotification);
ImGuiHelpers.ScaledDummy(3);
_uiShared.DrawHelpText("Special notification types:");
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("Pair Request Notifications:");
ImGui.SameLine();
ImGui.SetNextItemWidth(200 * ImGuiHelpers.GlobalScale);
_uiShared.DrawCombo("###enhanced_pairrequest", lightlessLocations, GetNotificationLocationLabel, (location) =>
{
_configService.Current.LightlessPairRequestNotification = location;
_configService.Save();
}, _configService.Current.LightlessPairRequestNotification);
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("Download Progress Notifications:");
ImGui.SameLine();
ImGui.SetNextItemWidth(200 * ImGuiHelpers.GlobalScale);
var downloadLocations = GetDownloadNotificationLocations();
_uiShared.DrawCombo("###enhanced_download", downloadLocations, GetNotificationLocationLabel, (location) =>
{
_configService.Current.LightlessDownloadNotification = location;
_configService.Save();
}, _configService.Current.LightlessDownloadNotification);
ImGui.Unindent();
}
@@ -2932,21 +2956,6 @@ public class SettingsUi : WindowMediatorSubscriberBase
ImGui.TreePop();
}
// Download Progress Notifications Section
if (_uiShared.MediumTreeNode("Download Progress Notifications", UIColors.Get("LightlessPurple")))
{
var useNotificationsForDownloads = _configService.Current.UseNotificationsForDownloads;
if (ImGui.Checkbox("Show download progress as notifications", ref useNotificationsForDownloads))
{
_configService.Current.UseNotificationsForDownloads = useNotificationsForDownloads;
_configService.Save();
}
_uiShared.DrawHelpText("Show download progress as clean notifications instead of overlay text. Notifications update in real-time and use the Info notification location settings above.");
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
ImGui.TreePop();
}
// System Notifications Section
if (_uiShared.MediumTreeNode("System Notifications", UIColors.Get("LightlessYellow")))
{
@@ -2972,8 +2981,19 @@ public class SettingsUi : WindowMediatorSubscriberBase
{
return new[]
{
NotificationLocation.LightlessUI,
NotificationLocation.ChatAndLightlessUI,
NotificationLocation.LightlessUi,
NotificationLocation.ChatAndLightlessUi,
NotificationLocation.Nowhere
};
}
private NotificationLocation[] GetDownloadNotificationLocations()
{
return new[]
{
NotificationLocation.LightlessUi,
NotificationLocation.ChatAndLightlessUi,
NotificationLocation.TextOverlay,
NotificationLocation.Nowhere
};
}
@@ -2997,8 +3017,9 @@ public class SettingsUi : WindowMediatorSubscriberBase
NotificationLocation.Chat => "Chat",
NotificationLocation.Toast => "Toast",
NotificationLocation.Both => "Toast + Chat",
NotificationLocation.LightlessUI => "Lightless Notifications",
NotificationLocation.ChatAndLightlessUI => "Chat + Lightless Notifications",
NotificationLocation.LightlessUi => "Lightless Notifications",
NotificationLocation.ChatAndLightlessUi => "Chat + Lightless Notifications",
NotificationLocation.TextOverlay => "Text Overlay",
_ => location.ToString()
};
}