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

Commit

Permalink
fix: changed the say hello to a better way.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 4, 2023
1 parent 772600a commit 6a4d36b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal partial class Strings
public string Commands_InsertAction { get; set; } = "Will use it within {0}s";

public string Commands_InsertActionFailure { get; set; } = "Can not find the action, please check the action name.";
public string Commands_SayHelloToAuthor { get; set; } = "({0}) is probably one of the authors of the \"Rotation Solver\", so say hello to him!";


#endregion

Expand Down
8 changes: 8 additions & 0 deletions RotationSolver/RotationSolverPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;
using Newtonsoft.Json;
Expand All @@ -24,6 +25,8 @@ public sealed class RotationSolverPlugin : IDalamudPlugin, IDisposable

static readonly List<IDisposable> _dis = new List<IDisposable>();
public string Name => "Rotation Solver";

public static DalamudLinkPayload LinkPayload { get; private set; }
public unsafe RotationSolverPlugin(DalamudPluginInterface pluginInterface)
{
pluginInterface.Create<Service>();
Expand Down Expand Up @@ -67,6 +70,11 @@ public unsafe RotationSolverPlugin(DalamudPluginInterface pluginInterface)
ChangeUITranslation();

RotationUpdater.GetAllCustomRotations();

LinkPayload = pluginInterface.AddChatLinkHandler(6, (id, str) =>
{
if(id == 6) OpenConfigWindow();
});
}


Expand Down
7 changes: 5 additions & 2 deletions RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ private static async void SayHelloToAuthor()
Service.TargetManager.SetTarget(author.c);
Service.SubmitToChat($"/{_macroToAuthor[new Random().Next(_macroToAuthor.Count)]} <t>");
#endif
var message = new SeString(new PlayerPayload(author.c.Name.TextValue, author.c.HomeWorld.Id)
, new TextPayload(string.Format(LocalizationManager.RightLang.Commands_SayHelloToAuthor, author.nameDesc)));
var message = new SeString(new PlayerPayload(author.c.Name.TextValue, author.c.HomeWorld.Id),
new TextPayload($"({author.nameDesc}) is probably one of the authors of the "),
RotationSolverPlugin.LinkPayload,
new TextPayload("Rotation Solver"),
new TextPayload(", so say hello to him/her!"));

Service.ChatGui.PrintChat(new Dalamud.Game.Text.XivChatEntry()
{
Expand Down

0 comments on commit 6a4d36b

Please sign in to comment.