diff --git a/RotationSolver.Basic/Service.cs b/RotationSolver.Basic/Service.cs index face6eb5c..25ff8ea10 100644 --- a/RotationSolver.Basic/Service.cs +++ b/RotationSolver.Basic/Service.cs @@ -100,9 +100,6 @@ public static unsafe uint GetAdjustedActionId(uint id) => ActionManager.Instance()->GetAdjustedActionId(id); - [PluginService] - public static ChatGui ChatGui { get; private set; } - public unsafe static IEnumerable GetAddons() where T : struct { if(typeof(T).GetCustomAttribute() is not Addon on) return Array.Empty(); diff --git a/RotationSolver/ActionSequencer/MajorConditionSet.cs b/RotationSolver/ActionSequencer/MajorConditionSet.cs index b6d63302a..4a3316a8e 100644 --- a/RotationSolver/ActionSequencer/MajorConditionSet.cs +++ b/RotationSolver/ActionSequencer/MajorConditionSet.cs @@ -1,4 +1,6 @@ -namespace RotationSolver.ActionSequencer; +using ECommons.DalamudServices; + +namespace RotationSolver.ActionSequencer; internal class MajorConditionSet { @@ -44,7 +46,7 @@ public static MajorConditionSet[] Read(string folder) } catch { - Service.ChatGui.Print($"Failed to load the conditionSet from {p}"); + Svc.Chat.Print($"Failed to load the conditionSet from {p}"); return null; } }).Where(set => set != null && !string.IsNullOrEmpty(set.Name)).ToArray(); diff --git a/RotationSolver/Commands/RSCommands_Actions.cs b/RotationSolver/Commands/RSCommands_Actions.cs index 6fbe43c56..e3d003174 100644 --- a/RotationSolver/Commands/RSCommands_Actions.cs +++ b/RotationSolver/Commands/RSCommands_Actions.cs @@ -43,7 +43,7 @@ public static void DoAction() #if DEBUG //if (nextAction is BaseAction acti) - // Service.ChatGui.Print($"Will Do {acti}"); + // Svc.Chat.Print($"Will Do {acti}"); #endif if (DataCenter.InHighEndDuty && !RotationUpdater.RightNowRotation.IsAllowed(out var str)) { @@ -69,7 +69,7 @@ public static void DoAction() if (act.ShouldEndSpecial) ResetSpecial(); #if DEBUG - //Service.ChatGui.Print($"{act}, {act.Target.Name}, {ActionUpdater.AbilityRemainCount}, {ActionUpdater.WeaponElapsed}"); + //Svc.Chat.Print($"{act}, {act.Target.Name}, {ActionUpdater.AbilityRemainCount}, {ActionUpdater.WeaponElapsed}"); #endif //Change Target if (((Service.TargetManager.Target?.IsNPCEnemy() ?? true) diff --git a/RotationSolver/Commands/RSCommands_OtherCommand.cs b/RotationSolver/Commands/RSCommands_OtherCommand.cs index 414b80b3c..52e67d344 100644 --- a/RotationSolver/Commands/RSCommands_OtherCommand.cs +++ b/RotationSolver/Commands/RSCommands_OtherCommand.cs @@ -1,4 +1,5 @@ -using RotationSolver.Localization; +using ECommons.DalamudServices; +using RotationSolver.Localization; using RotationSolver.Updaters; namespace RotationSolver.Commands @@ -41,7 +42,7 @@ private static void DoSettingCommand(string str) Basic.Configuration.PluginConfiguration.SetValue(type, !Basic.Configuration.PluginConfiguration.GetValue(type)); //Say out. - Service.ChatGui.Print(string.Format(LocalizationManager.RightLang.Commands_ChangeSettingsValue, + Svc.Chat.Print(string.Format(LocalizationManager.RightLang.Commands_ChangeSettingsValue, type.ToString(), Basic.Configuration.PluginConfiguration.GetValue(type))); } @@ -91,7 +92,7 @@ private static void DoActionCommand(string str) } } - Service.ChatGui.PrintError(LocalizationManager.RightLang.Commands_InsertActionFailure); + Svc.Chat.PrintError(LocalizationManager.RightLang.Commands_InsertActionFailure); } @@ -102,13 +103,13 @@ private static void DoRotationCommand(ICustomRotation customCombo, string str) { if (config.DoCommand(configs, str)) { - Service.ChatGui.Print(string.Format(LocalizationManager.RightLang.Commands_ChangeRotationConfig, + Svc.Chat.Print(string.Format(LocalizationManager.RightLang.Commands_ChangeRotationConfig, config.DisplayName, configs.GetDisplayString(config.Name))); return; } } - Service.ChatGui.Print(LocalizationManager.RightLang.Commands_CannotFindRotationConfig); + Svc.Chat.Print(LocalizationManager.RightLang.Commands_CannotFindRotationConfig); } } } diff --git a/RotationSolver/Updaters/RotationUpdater.cs b/RotationSolver/Updaters/RotationUpdater.cs index c239d5ded..50b769cfb 100644 --- a/RotationSolver/Updaters/RotationUpdater.cs +++ b/RotationSolver/Updaters/RotationUpdater.cs @@ -261,7 +261,7 @@ private static void PrintLoadedAssemblies(IEnumerable assemblies) { foreach (var assembly in assemblies) { - Service.ChatGui.Print("Loaded: " + assembly); + Svc.Chat.Print("Loaded: " + assembly); } } diff --git a/RotationSolver/Updaters/SocialUpdater.cs b/RotationSolver/Updaters/SocialUpdater.cs index e56d33b05..8af0ec906 100644 --- a/RotationSolver/Updaters/SocialUpdater.cs +++ b/RotationSolver/Updaters/SocialUpdater.cs @@ -3,6 +3,8 @@ using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling.Payloads; using Dalamud.Logging; +using ECommons.Automation; +using ECommons.DalamudServices; using ECommons.GameHelpers; using FFXIVClientStructs.FFXIV.Client.UI; using Lumina.Excel.GeneratedSheets; @@ -108,7 +110,7 @@ static void DutyState_DutyStarted(object sender, ushort e) { var message = string.Format(LocalizationManager.RightLang.HighEndWarning, GetDutyName(territory)); - Service.ChatGui.PrintChat(new Dalamud.Game.Text.XivChatEntry() + Svc.Chat.PrintChat(new Dalamud.Game.Text.XivChatEntry() { Message = new SeString( new IconPayload(BitmapFontIcon.DPS), @@ -155,7 +157,7 @@ internal static async void UpdateSocial() { _canSaying = false; #if DEBUG - Service.ChatGui.Print("Macro now."); + Svc.Chat.Print("Macro now."); #endif Service.Config.DutyStart.AddMacro(); await Task.Delay(new Random().Next(1000, 1500)); @@ -187,7 +189,7 @@ private static async void SayHelloToAuthor() #if DEBUG #else Service.TargetManager.SetTarget(c); - Service.SubmitToChat($"/{_macroToAuthor[new Random().Next(_macroToAuthor.Count)]} "); + Chat.Instance.SendMessage($"/{_macroToAuthor[new Random().Next(_macroToAuthor.Count)]} "); #endif var message = new SeString(new IconPayload(BitmapFontIcon.Mentor), @@ -206,7 +208,7 @@ private static async void SayHelloToAuthor() new TextPayload(". So say hello to him/her!")); - Service.ChatGui.PrintChat(new Dalamud.Game.Text.XivChatEntry() + Svc.Chat.PrintChat(new Dalamud.Game.Text.XivChatEntry() { Message = message, Type = Dalamud.Game.Text.XivChatType.Notice, diff --git a/RotationSolver/bin/Release/net7.0-windows/RotationSolver/latest.zip b/RotationSolver/bin/Release/net7.0-windows/RotationSolver/latest.zip index 0a7620a99..9ff726cee 100644 Binary files a/RotationSolver/bin/Release/net7.0-windows/RotationSolver/latest.zip and b/RotationSolver/bin/Release/net7.0-windows/RotationSolver/latest.zip differ