Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to toggle link after maplink #679

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AetheryteLinkInChat/AetheryteLinkInChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ private void AppendNearestAetheryteLink(ref SeString message)
payloads.Insert(0, new TextPayload("\n"));
message.Payloads.AddRange(payloads);
}
else if (Config.DisplayLinkAtEnd)
{
message.Payloads.AddRange(payloads);
}
else
{
var mapIndex = message.Payloads.FindIndex(p => p.GetType() == typeof(MapLinkPayload)) + 8;
Expand Down
1 change: 1 addition & 0 deletions AetheryteLinkInChat/Config/PluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class PluginConfig : IPluginConfiguration
public bool ConsiderTeleportsToOtherWorlds;
public bool EnableLifestreamIntegration;
public bool DisplayLineBreak;
public bool DisplayLinkAtEnd;

public bool EnableChatNotificationOnTeleport = true;
public bool EnableQuestNotificationOnTeleport = true;
Expand Down
8 changes: 8 additions & 0 deletions AetheryteLinkInChat/Config/PluginConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ private void DrawGeneralTab()

ImGui.Checkbox(Localization.DisplayLineBreak, ref Config.DisplayLineBreak);

// Maybe not the best location for this...
if (Config.DisplayLineBreak)
Config.DisplayLinkAtEnd = true;

ImGui.BeginDisabled(Config.DisplayLineBreak);
ImGui.Checkbox(Localization.DisplayLinkAtEnd, ref Config.DisplayLinkAtEnd);
ImGui.EndDisabled();

ImGui.Checkbox(Localization.EnableChatNotificationOnTeleport, ref Config.EnableChatNotificationOnTeleport);
ImGui.Checkbox(Localization.EnableQuestNotificationOnTeleport, ref Config.EnableQuestNotificationOnTeleport);

Expand Down
6 changes: 6 additions & 0 deletions AetheryteLinkInChat/Localization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ public static class Localization
Ja = "テレポリンクの前に改行を入れる",
};

public static readonly LocalizedString DisplayLinkAtEnd = new()
{
En = "Display teleport link at the end of the message",
Ja = "メッセージの最後にテレポート リンクを表示する",
};

public static readonly LocalizedString EnableChatNotificationOnTeleport = new()
{
En = "Enable Chat Notification on Teleport",
Expand Down