mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 16:47:22 +01:00
preliminary api10 update
This commit is contained in:
parent
8c56c91374
commit
b9cf7eb6fa
34 changed files with 163 additions and 137 deletions
|
|
@ -1,11 +1,11 @@
|
|||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Internal.Notifications;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Plugin.Services;
|
||||
using MareSynchronos.MareConfiguration;
|
||||
using MareSynchronos.MareConfiguration.Models;
|
||||
using MareSynchronos.Services.Mediator;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NotificationType = MareSynchronos.MareConfiguration.Models.NotificationType;
|
||||
|
||||
namespace MareSynchronos.Services;
|
||||
|
||||
|
|
@ -15,7 +15,8 @@ public class NotificationService : DisposableMediatorSubscriberBase
|
|||
private readonly IChatGui _chatGui;
|
||||
private readonly MareConfigService _configurationService;
|
||||
|
||||
public NotificationService(ILogger<NotificationService> logger, MareMediator mediator, INotificationManager notificationManager, IChatGui chatGui, MareConfigService configurationService) : base(logger, mediator)
|
||||
public NotificationService(ILogger<NotificationService> logger, MareMediator mediator, INotificationManager notificationManager,
|
||||
IChatGui chatGui, MareConfigService configurationService) : base(logger, mediator)
|
||||
{
|
||||
_notificationManager = notificationManager;
|
||||
_chatGui = chatGui;
|
||||
|
|
@ -47,8 +48,6 @@ public class NotificationService : DisposableMediatorSubscriberBase
|
|||
switch (msg.Type)
|
||||
{
|
||||
case NotificationType.Info:
|
||||
case NotificationType.Success:
|
||||
case NotificationType.None:
|
||||
PrintInfoChat(msg.Message);
|
||||
break;
|
||||
|
||||
|
|
@ -69,8 +68,6 @@ public class NotificationService : DisposableMediatorSubscriberBase
|
|||
switch (msg.Type)
|
||||
{
|
||||
case NotificationType.Info:
|
||||
case NotificationType.Success:
|
||||
case NotificationType.None:
|
||||
ShowNotificationLocationBased(msg, _configurationService.Current.InfoNotification);
|
||||
break;
|
||||
|
||||
|
|
@ -108,11 +105,19 @@ public class NotificationService : DisposableMediatorSubscriberBase
|
|||
|
||||
private void ShowToast(NotificationMessage msg)
|
||||
{
|
||||
_notificationManager.AddNotification(new Dalamud.Interface.ImGuiNotification.Notification()
|
||||
Dalamud.Interface.ImGuiNotification.NotificationType dalamudType = msg.Type switch
|
||||
{
|
||||
MareConfiguration.Models.NotificationType.Error => Dalamud.Interface.ImGuiNotification.NotificationType.Error,
|
||||
MareConfiguration.Models.NotificationType.Warning => Dalamud.Interface.ImGuiNotification.NotificationType.Warning,
|
||||
MareConfiguration.Models.NotificationType.Info => Dalamud.Interface.ImGuiNotification.NotificationType.Info,
|
||||
_ => Dalamud.Interface.ImGuiNotification.NotificationType.Info
|
||||
};
|
||||
|
||||
_notificationManager.AddNotification(new Notification()
|
||||
{
|
||||
Content = msg.Message ?? string.Empty,
|
||||
Title = msg.Title,
|
||||
Type = msg.Type,
|
||||
Type = dalamudType,
|
||||
Minimized = false,
|
||||
InitialDuration = msg.TimeShownOnScreen ?? TimeSpan.FromSeconds(3)
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue