Skip to content

Commit

Permalink
Merge pull request #679 from Diyagi/MapLinkOption
Browse files Browse the repository at this point in the history
Add option to toggle link after maplink
  • Loading branch information
SlashNephy committed Sep 19, 2024
2 parents 7856f43 + e877ac4 commit 40b1abe
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
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

0 comments on commit 40b1abe

Please sign in to comment.