Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: change chat gui.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed May 18, 2023
1 parent 719e0ff commit c6b2185
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
3 changes: 0 additions & 3 deletions RotationSolver.Basic/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IntPtr> GetAddons<T>() where T : struct
{
if(typeof(T).GetCustomAttribute<Addon>() is not Addon on) return Array.Empty<nint>();
Expand Down
6 changes: 4 additions & 2 deletions RotationSolver/ActionSequencer/MajorConditionSet.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace RotationSolver.ActionSequencer;
using ECommons.DalamudServices;

namespace RotationSolver.ActionSequencer;

internal class MajorConditionSet
{
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand All @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions RotationSolver/Commands/RSCommands_OtherCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using RotationSolver.Localization;
using ECommons.DalamudServices;
using RotationSolver.Localization;
using RotationSolver.Updaters;

namespace RotationSolver.Commands
Expand Down Expand Up @@ -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)));
}

Expand Down Expand Up @@ -91,7 +92,7 @@ private static void DoActionCommand(string str)
}
}

Service.ChatGui.PrintError(LocalizationManager.RightLang.Commands_InsertActionFailure);
Svc.Chat.PrintError(LocalizationManager.RightLang.Commands_InsertActionFailure);
}


Expand All @@ -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);
}
}
}
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/RotationUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private static void PrintLoadedAssemblies(IEnumerable<string> assemblies)
{
foreach (var assembly in assemblies)
{
Service.ChatGui.Print("Loaded: " + assembly);
Svc.Chat.Print("Loaded: " + assembly);
}
}

Expand Down
10 changes: 6 additions & 4 deletions RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -187,7 +189,7 @@ private static async void SayHelloToAuthor()
#if DEBUG
#else
Service.TargetManager.SetTarget(c);
Service.SubmitToChat($"/{_macroToAuthor[new Random().Next(_macroToAuthor.Count)]} <t>");
Chat.Instance.SendMessage($"/{_macroToAuthor[new Random().Next(_macroToAuthor.Count)]} <t>");
#endif
var message = new SeString(new IconPayload(BitmapFontIcon.Mentor),

Expand All @@ -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,
Expand Down
Binary file not shown.

0 comments on commit c6b2185

Please sign in to comment.