- API 15
- Migrate config for API 15 - Migrate database for API 15 - Allow usage of new target source - Implement first tell target option
This commit is contained in:
+50
-26
@@ -19,30 +19,30 @@ namespace ChatTwo;
|
||||
// ReSharper disable once ClassNeverInstantiated.Global
|
||||
public sealed class Plugin : IDalamudPlugin
|
||||
{
|
||||
internal const string PluginName = "Chat 2";
|
||||
public const string PluginName = "Chat 2";
|
||||
|
||||
[PluginService] internal static IPluginLog Log { get; private set; } = null!;
|
||||
[PluginService] internal static IDalamudPluginInterface Interface { get; private set; } = null!;
|
||||
[PluginService] internal static IChatGui ChatGui { get; private set; } = null!;
|
||||
[PluginService] internal static IClientState ClientState { get; private set; } = null!;
|
||||
[PluginService] internal static ICommandManager CommandManager { get; private set; } = null!;
|
||||
[PluginService] internal static ICondition Condition { get; private set; } = null!;
|
||||
[PluginService] internal static IDataManager DataManager { get; private set; } = null!;
|
||||
[PluginService] internal static IFramework Framework { get; private set; } = null!;
|
||||
[PluginService] internal static IGameGui GameGui { get; private set; } = null!;
|
||||
[PluginService] internal static IKeyState KeyState { get; private set; } = null!;
|
||||
[PluginService] internal static IObjectTable ObjectTable { get; private set; } = null!;
|
||||
[PluginService] internal static IPartyList PartyList { get; private set; } = null!;
|
||||
[PluginService] internal static ITargetManager TargetManager { get; private set; } = null!;
|
||||
[PluginService] internal static ITextureProvider TextureProvider { get; private set; } = null!;
|
||||
[PluginService] internal static IGameInteropProvider GameInteropProvider { get; private set; } = null!;
|
||||
[PluginService] internal static IGameConfig GameConfig { get; private set; } = null!;
|
||||
[PluginService] internal static INotificationManager Notification { get; private set; } = null!;
|
||||
[PluginService] internal static IAddonLifecycle AddonLifecycle { get; private set; } = null!;
|
||||
[PluginService] internal static IPlayerState PlayerState { get; private set; } = null!;
|
||||
[PluginService] internal static ISeStringEvaluator Evaluator { get; private set; } = null!;
|
||||
[PluginService] public static IPluginLog Log { get; private set; } = null!;
|
||||
[PluginService] public static IDalamudPluginInterface Interface { get; private set; } = null!;
|
||||
[PluginService] public static IChatGui ChatGui { get; private set; } = null!;
|
||||
[PluginService] public static IClientState ClientState { get; private set; } = null!;
|
||||
[PluginService] public static ICommandManager CommandManager { get; private set; } = null!;
|
||||
[PluginService] public static ICondition Condition { get; private set; } = null!;
|
||||
[PluginService] public static IDataManager DataManager { get; private set; } = null!;
|
||||
[PluginService] public static IFramework Framework { get; private set; } = null!;
|
||||
[PluginService] public static IGameGui GameGui { get; private set; } = null!;
|
||||
[PluginService] public static IKeyState KeyState { get; private set; } = null!;
|
||||
[PluginService] public static IObjectTable ObjectTable { get; private set; } = null!;
|
||||
[PluginService] public static IPartyList PartyList { get; private set; } = null!;
|
||||
[PluginService] public static ITargetManager TargetManager { get; private set; } = null!;
|
||||
[PluginService] public static ITextureProvider TextureProvider { get; private set; } = null!;
|
||||
[PluginService] public static IGameInteropProvider GameInteropProvider { get; private set; } = null!;
|
||||
[PluginService] public static IGameConfig GameConfig { get; private set; } = null!;
|
||||
[PluginService] public static INotificationManager Notification { get; private set; } = null!;
|
||||
[PluginService] public static IAddonLifecycle AddonLifecycle { get; private set; } = null!;
|
||||
[PluginService] public static IPlayerState PlayerState { get; private set; } = null!;
|
||||
[PluginService] public static ISeStringEvaluator Evaluator { get; private set; } = null!;
|
||||
|
||||
internal static Configuration Config = null!;
|
||||
public static Configuration Config = null!;
|
||||
public static FileDialogManager FileDialogManager { get; private set; } = null!;
|
||||
|
||||
public readonly WindowSystem WindowSystem = new(PluginName);
|
||||
@@ -62,7 +62,7 @@ public sealed class Plugin : IDalamudPlugin
|
||||
internal TypingIpc TypingIpc { get; }
|
||||
internal FontManager FontManager { get; }
|
||||
|
||||
internal ServerCore ServerCore { get; }
|
||||
public readonly ServerCore ServerCore;
|
||||
|
||||
internal int DeferredSaveFrames = -1;
|
||||
|
||||
@@ -88,23 +88,47 @@ public sealed class Plugin : IDalamudPlugin
|
||||
|
||||
Config = Interface.GetPluginConfig() as Configuration ?? new Configuration();
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
// TODO Remove after 01.07.2026
|
||||
// Migrate old channel values
|
||||
if (Config.Version <= 5)
|
||||
{
|
||||
foreach (var tab in Config.Tabs)
|
||||
{
|
||||
if (tab.ChatCodes.Count > 0)
|
||||
{
|
||||
tab.SelectedChannels = tab.ChatCodes.ToDictionary(pair => pair.Key, pair => (pair.Value, pair.Value));
|
||||
tab.ChatCodes.Clear();
|
||||
}
|
||||
|
||||
if (Config.InactivityHideChannels.Count > 0)
|
||||
{
|
||||
Config.InactivityHideChannelsV2 = Config.InactivityHideChannels.ToDictionary(pair => pair.Key, pair => (pair.Value, pair.Value));
|
||||
Config.InactivityHideChannels.Clear();
|
||||
}
|
||||
|
||||
Config.Version = 6;
|
||||
SaveConfig();
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
if (Config.Tabs.Count == 0)
|
||||
Config.Tabs.Add(TabsUtil.VanillaGeneral);
|
||||
Config.InactivityHideChannels ??= TabsUtil.AllChannels();
|
||||
|
||||
LanguageChanged(Interface.UiLanguage);
|
||||
ImGuiUtil.Initialize(this);
|
||||
|
||||
FileDialogManager = new FileDialogManager();
|
||||
|
||||
// Functions calls this in its ctor if the player is already logged in
|
||||
// Function call this in its ctor if the player is already logged in
|
||||
ServerCore = new ServerCore(this);
|
||||
|
||||
Commands = new Commands();
|
||||
Functions = new GameFunctions.GameFunctions(this);
|
||||
Ipc = new IpcManager();
|
||||
TypingIpc = new TypingIpc(this);
|
||||
ExtraChat = new ExtraChat(this);
|
||||
ExtraChat = new ExtraChat();
|
||||
FontManager = new FontManager();
|
||||
|
||||
ChatLogWindow = new ChatLogWindow(this);
|
||||
|
||||
Reference in New Issue
Block a user