Chat notification for testing version
This commit is contained in:
@@ -138,7 +138,8 @@ public static class ServiceManagerBuilder
|
||||
.AddSingleton<FilenameService>()
|
||||
.AddSingleton<BackupService>()
|
||||
.AddSingleton<FrameworkManager>()
|
||||
.AddSingleton<SupportLogBuilderService>();
|
||||
.AddSingleton<SupportLogBuilderService>()
|
||||
.AddSingleton<TestingVersionNotifierService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
32
CustomizePlus/Core/Services/TestingVersionNotifierService.cs
Normal file
32
CustomizePlus/Core/Services/TestingVersionNotifierService.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using CustomizePlus.Core.Helpers;
|
||||
using CustomizePlus.Game.Services;
|
||||
using Dalamud.Plugin.Services;
|
||||
|
||||
namespace CustomizePlus.Core.Services;
|
||||
|
||||
public class TestingVersionNotifierService : IDisposable
|
||||
{
|
||||
private readonly IClientState _clientState;
|
||||
private readonly ChatService _chatService;
|
||||
|
||||
public TestingVersionNotifierService(IClientState clientState, ChatService chatService)
|
||||
{
|
||||
_clientState = clientState;
|
||||
_chatService = chatService;
|
||||
|
||||
_clientState.Login += OnLogin;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_clientState.Login -= OnLogin;
|
||||
}
|
||||
|
||||
private void OnLogin()
|
||||
{
|
||||
if (VersionHelper.IsTesting)
|
||||
_chatService.PrintInChat($"You are running testing version of Customize+! Some features like integration with other plugins might not function correctly.",
|
||||
ChatService.ChatMessageColor.Warning);
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ public sealed class Plugin : IDalamudPlugin
|
||||
|
||||
_services.GetService<ActorManager>(); //needs to be initialized early for config to be read properly
|
||||
|
||||
_services.GetService<TestingVersionNotifierService>();
|
||||
_services.GetService<CustomizePlusIpc>();
|
||||
_services.GetService<CPlusWindowSystem>();
|
||||
_services.GetService<CommandService>();
|
||||
|
||||
Reference in New Issue
Block a user