removed fallback logic in NotificationService and some settings cleanup
This commit is contained in:
@@ -336,43 +336,24 @@ public class NotificationService : DisposableMediatorSubscriberBase, IHostedServ
|
||||
|
||||
if (!_dalamudUtilService.IsLoggedIn) return;
|
||||
|
||||
// Get both old and new notification locations
|
||||
var oldLocation = msg.Type switch
|
||||
{
|
||||
NotificationType.Info => _configService.Current.InfoNotification,
|
||||
NotificationType.Warning => _configService.Current.WarningNotification,
|
||||
NotificationType.Error => _configService.Current.ErrorNotification,
|
||||
_ => NotificationLocation.Nowhere
|
||||
};
|
||||
|
||||
var newLocation = msg.Type switch
|
||||
{
|
||||
NotificationType.Info => _configService.Current.LightlessInfoNotification,
|
||||
NotificationType.Warning => _configService.Current.LightlessWarningNotification,
|
||||
NotificationType.Error => _configService.Current.LightlessErrorNotification,
|
||||
_ => NotificationLocation.LightlessUI
|
||||
};
|
||||
|
||||
// Show notifications based on system selection with backwards compatibility
|
||||
if (!_configService.Current.UseLightlessNotifications)
|
||||
{
|
||||
// Only use old system when new system is disabled
|
||||
ShowNotificationLocationBased(msg, oldLocation);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use new system as primary
|
||||
ShowNotificationLocationBased(msg, newLocation);
|
||||
|
||||
// Also use old system as fallback for backwards compatibility
|
||||
// Only if it's different from the new location and not "Nowhere"
|
||||
if (oldLocation != NotificationLocation.Nowhere &&
|
||||
oldLocation != newLocation &&
|
||||
!IsLightlessLocation(oldLocation))
|
||||
// Get notification location based on type and system pref
|
||||
var location = _configService.Current.UseLightlessNotifications
|
||||
? msg.Type switch
|
||||
{
|
||||
ShowNotificationLocationBased(msg, oldLocation);
|
||||
NotificationType.Info => _configService.Current.LightlessInfoNotification,
|
||||
NotificationType.Warning => _configService.Current.LightlessWarningNotification,
|
||||
NotificationType.Error => _configService.Current.LightlessErrorNotification,
|
||||
_ => NotificationLocation.LightlessUI
|
||||
}
|
||||
}
|
||||
: msg.Type switch
|
||||
{
|
||||
NotificationType.Info => _configService.Current.InfoNotification,
|
||||
NotificationType.Warning => _configService.Current.WarningNotification,
|
||||
NotificationType.Error => _configService.Current.ErrorNotification,
|
||||
_ => NotificationLocation.Nowhere
|
||||
};
|
||||
|
||||
ShowNotificationLocationBased(msg, location);
|
||||
}
|
||||
|
||||
private void ShowNotificationLocationBased(NotificationMessage msg, NotificationLocation location)
|
||||
@@ -488,13 +469,4 @@ public class NotificationService : DisposableMediatorSubscriberBase, IHostedServ
|
||||
_chatGui.Print(se.BuiltString);
|
||||
}
|
||||
|
||||
private bool IsLightlessLocation(NotificationLocation location)
|
||||
{
|
||||
return location switch
|
||||
{
|
||||
NotificationLocation.LightlessUI => true,
|
||||
NotificationLocation.ChatAndLightlessUI => true,
|
||||
_ => false
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user