Add changelog tab
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>1.25.1</Version>
|
<Version>1.25.2</Version>
|
||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|||||||
@@ -21,3 +21,34 @@ tags:
|
|||||||
- UI
|
- UI
|
||||||
- Chat
|
- Chat
|
||||||
- Replacement
|
- Replacement
|
||||||
|
changelog: |-
|
||||||
|
**New**
|
||||||
|
- Changelog tab
|
||||||
|
- Shows the latest changelog
|
||||||
|
- Has an option to disable printing of changelogs to chat
|
||||||
|
|
||||||
|
**Message Preview**
|
||||||
|
- Message preview has now its own config tab
|
||||||
|
- Added a new position: Tooltip
|
||||||
|
- Shows up while hovering the input box
|
||||||
|
- This won't support the letter selection or any of the hover features
|
||||||
|
- Added option to set a minimum length before message preview appears
|
||||||
|
- Added option to only show preview if special parameter are used (<item>, emotes...)
|
||||||
|
- Selectable letters in message preview
|
||||||
|
- Click on any letter and the text cursor will jump to its position
|
||||||
|
- Better word wrapping in message preview
|
||||||
|
|
||||||
|
**Fixes**
|
||||||
|
- Prevent rare null reference on plugin load
|
||||||
|
- Prevent null strings from being parsed
|
||||||
|
- Parsing of emotes works with punctuation and non latin letters surrounding it
|
||||||
|
|
||||||
|
**Future Updates**
|
||||||
|
- Message preview will receive numerous features over the next weeks
|
||||||
|
- More parameter will be supported (<t> ...)
|
||||||
|
- Better customization (Position it anywhere)
|
||||||
|
- Feedback is always welcome
|
||||||
|
- If you want to disable this feature all together, visit the Preview tab in your config
|
||||||
|
- Fix for dalamuds welcome messages getting shuffled
|
||||||
|
- Message history viewer, going above the 10,000 that chat2 can display at once
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ internal class Configuration : IPluginConfiguration
|
|||||||
public bool HideSameTimestamps;
|
public bool HideSameTimestamps;
|
||||||
public bool ShowNoviceNetwork;
|
public bool ShowNoviceNetwork;
|
||||||
public bool SidebarTabView;
|
public bool SidebarTabView;
|
||||||
|
public bool PrintChangelog = true;
|
||||||
public bool OnlyPreviewIf;
|
public bool OnlyPreviewIf;
|
||||||
public int PreviewMinimum = 1;
|
public int PreviewMinimum = 1;
|
||||||
public PreviewPosition PreviewPosition = PreviewPosition.Inside;
|
public PreviewPosition PreviewPosition = PreviewPosition.Inside;
|
||||||
@@ -81,6 +82,7 @@ internal class Configuration : IPluginConfiguration
|
|||||||
HideSameTimestamps = other.HideSameTimestamps;
|
HideSameTimestamps = other.HideSameTimestamps;
|
||||||
ShowNoviceNetwork = other.ShowNoviceNetwork;
|
ShowNoviceNetwork = other.ShowNoviceNetwork;
|
||||||
SidebarTabView = other.SidebarTabView;
|
SidebarTabView = other.SidebarTabView;
|
||||||
|
PrintChangelog = other.PrintChangelog;
|
||||||
OnlyPreviewIf = other.OnlyPreviewIf;
|
OnlyPreviewIf = other.OnlyPreviewIf;
|
||||||
PreviewMinimum = other.PreviewMinimum;
|
PreviewMinimum = other.PreviewMinimum;
|
||||||
PreviewPosition = other.PreviewPosition;
|
PreviewPosition = other.PreviewPosition;
|
||||||
|
|||||||
+3
-2
@@ -4,6 +4,7 @@ using ChatTwo.Util;
|
|||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using Dalamud.Game.Text;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||||
using LiteDB;
|
using LiteDB;
|
||||||
@@ -292,7 +293,7 @@ internal partial class Message
|
|||||||
? Plugin.DataManager.GetExcelSheet<Item>()!.GetRow(item.ItemID)!.Name.ToString()
|
? Plugin.DataManager.GetExcelSheet<Item>()!.GetRow(item.ItemID)!.Name.ToString()
|
||||||
: Plugin.DataManager.GetExcelSheet<EventItem>()!.GetRow(item.ItemID)!.Name.ToString();
|
: Plugin.DataManager.GetExcelSheet<EventItem>()!.GetRow(item.ItemID)!.Name.ToString();
|
||||||
|
|
||||||
var link = new ItemPayload(item.ItemID, kind, name);
|
var link = new ItemPayload(item.ItemID, kind, $"{SeIconChar.LinkMarker.ToIconChar()}{name}");
|
||||||
AddChunkWithMessage(text.NewWithStyle(chunk.Source, link, link.DisplayName ?? "Unknown"));
|
AddChunkWithMessage(text.NewWithStyle(chunk.Source, link, link.DisplayName ?? "Unknown"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -309,7 +310,7 @@ internal partial class Message
|
|||||||
var rawY = (int)(MathF.Round(mapCoords.YFloat, 3, MidpointRounding.AwayFromZero) * 1000);
|
var rawY = (int)(MathF.Round(mapCoords.YFloat, 3, MidpointRounding.AwayFromZero) * 1000);
|
||||||
|
|
||||||
var link = new MapLinkPayload(mapCoords.TerritoryId, mapCoords.MapId, rawX, rawY);
|
var link = new MapLinkPayload(mapCoords.TerritoryId, mapCoords.MapId, rawX, rawY);
|
||||||
AddChunkWithMessage(text.NewWithStyle(chunk.Source, link, $"{link.PlaceName} {link.CoordinateString}"));
|
AddChunkWithMessage(text.NewWithStyle(chunk.Source, link, $"{SeIconChar.LinkMarker.ToIconChar()}{link.PlaceName} {link.CoordinateString}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+50
-5
@@ -1598,6 +1598,24 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Changelog:.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Options_Changelog_Header {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Options_Changelog_Header", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Changelog.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Options_Changelog_Tab {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Options_Changelog_Tab", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Import from game.
|
/// Looks up a localized string similar to Import from game.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2175,7 +2193,7 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Keeps the input focus, even if you enter battle or do other actions.
|
/// Looks up a localized string similar to Keeps the input focus, even if you enter battle or do other actions..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Options_KeepInputFocus_Description {
|
internal static string Options_KeepInputFocus_Description {
|
||||||
get {
|
get {
|
||||||
@@ -2400,7 +2418,7 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Displays a preview with special parameter evaluated, like emotes and <item>.
|
/// Looks up a localized string similar to Displays a preview with special parameter evaluated, like emotes and <item>..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Options_Preview_Description {
|
internal static string Options_Preview_Description {
|
||||||
get {
|
get {
|
||||||
@@ -2472,7 +2490,7 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Only show if the text length is greater-than or equal.
|
/// Looks up a localized string similar to Only show if the text length is greater-than or equal..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Options_PreviewMinimum_Description {
|
internal static string Options_PreviewMinimum_Description {
|
||||||
get {
|
get {
|
||||||
@@ -2490,7 +2508,7 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Only show if the text contains special parameter.
|
/// Looks up a localized string similar to Only show if the text contains special parameter..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Options_PreviewOnlyIf_Description {
|
internal static string Options_PreviewOnlyIf_Description {
|
||||||
get {
|
get {
|
||||||
@@ -2508,7 +2526,25 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Replaces words with their emote version, currently supports BetterTTV.
|
/// Looks up a localized string similar to Print the changelog to chat after an update..
|
||||||
|
/// </summary>
|
||||||
|
internal static string Options_PrintChangelog_Description {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Options_PrintChangelog_Description", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Print changelog.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Options_PrintChangelog_Name {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Options_PrintChangelog_Name", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Replaces words with their emote version, currently supports BetterTTV..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Options_ShowEmotes_Desc {
|
internal static string Options_ShowEmotes_Desc {
|
||||||
get {
|
get {
|
||||||
@@ -2840,6 +2876,15 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to This feature isn't implemented yet.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Options_Warning_NotImplemented {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Options_Warning_NotImplemented", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Window opacity.
|
/// Looks up a localized string similar to Window opacity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1016,13 +1016,13 @@
|
|||||||
<value>Keep input focus</value>
|
<value>Keep input focus</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_KeepInputFocus_Description" xml:space="preserve">
|
<data name="Options_KeepInputFocus_Description" xml:space="preserve">
|
||||||
<value>Keeps the input focus, even if you enter battle or do other actions</value>
|
<value>Keeps the input focus, even if you enter battle or do other actions.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_ShowEmotes_Name" xml:space="preserve">
|
<data name="Options_ShowEmotes_Name" xml:space="preserve">
|
||||||
<value>Show emotes</value>
|
<value>Show emotes</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_ShowEmotes_Desc" xml:space="preserve">
|
<data name="Options_ShowEmotes_Desc" xml:space="preserve">
|
||||||
<value>Replaces words with their emote version, currently supports BetterTTV</value>
|
<value>Replaces words with their emote version, currently supports BetterTTV.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_Emote_Tab" xml:space="preserve">
|
<data name="Options_Emote_Tab" xml:space="preserve">
|
||||||
<value>Emotes</value>
|
<value>Emotes</value>
|
||||||
@@ -1052,7 +1052,7 @@
|
|||||||
<value>Emotes available:</value>
|
<value>Emotes available:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_Preview_Description" xml:space="preserve">
|
<data name="Options_Preview_Description" xml:space="preserve">
|
||||||
<value>Displays a preview with special parameter evaluated, like emotes and <item></value>
|
<value>Displays a preview with special parameter evaluated, like emotes and <item>.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_Preview_Name" xml:space="preserve">
|
<data name="Options_Preview_Name" xml:space="preserve">
|
||||||
<value>Position (None = off)</value>
|
<value>Position (None = off)</value>
|
||||||
@@ -1079,15 +1079,30 @@
|
|||||||
<value>Must contain parameter</value>
|
<value>Must contain parameter</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_PreviewOnlyIf_Description" xml:space="preserve">
|
<data name="Options_PreviewOnlyIf_Description" xml:space="preserve">
|
||||||
<value>Only show if the text contains special parameter</value>
|
<value>Only show if the text contains special parameter.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_PreviewMinimum_Name" xml:space="preserve">
|
<data name="Options_PreviewMinimum_Name" xml:space="preserve">
|
||||||
<value>Minimum input length</value>
|
<value>Minimum input length</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_PreviewMinimum_Description" xml:space="preserve">
|
<data name="Options_PreviewMinimum_Description" xml:space="preserve">
|
||||||
<value>Only show if the text length is greater-than or equal</value>
|
<value>Only show if the text length is greater-than or equal.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Options_Preview_Tab" xml:space="preserve">
|
<data name="Options_Preview_Tab" xml:space="preserve">
|
||||||
<value>Preview</value>
|
<value>Preview</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Options_Changelog_Tab" xml:space="preserve">
|
||||||
|
<value>Changelog</value>
|
||||||
|
</data>
|
||||||
|
<data name="Options_PrintChangelog_Name" xml:space="preserve">
|
||||||
|
<value>Print changelog</value>
|
||||||
|
</data>
|
||||||
|
<data name="Options_PrintChangelog_Description" xml:space="preserve">
|
||||||
|
<value>Print the changelog to chat after an update.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Options_Warning_NotImplemented" xml:space="preserve">
|
||||||
|
<value>This feature isn't implemented yet</value>
|
||||||
|
</data>
|
||||||
|
<data name="Options_Changelog_Header" xml:space="preserve">
|
||||||
|
<value>Changelog:</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public sealed class SettingsWindow : Window
|
|||||||
new Tabs(Plugin, Mutable),
|
new Tabs(Plugin, Mutable),
|
||||||
new Database(Plugin, Mutable),
|
new Database(Plugin, Mutable),
|
||||||
new Miscellaneous(Mutable),
|
new Miscellaneous(Mutable),
|
||||||
|
new Changelog(Mutable),
|
||||||
new About(),
|
new About(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
using ChatTwo.Resources;
|
||||||
|
using ChatTwo.Util;
|
||||||
|
using Dalamud.Interface.Utility.Raii;
|
||||||
|
using ImGuiNET;
|
||||||
|
|
||||||
|
namespace ChatTwo.Ui.SettingsTabs;
|
||||||
|
|
||||||
|
internal sealed class Changelog : ISettingsTab
|
||||||
|
{
|
||||||
|
private Configuration Mutable { get; }
|
||||||
|
|
||||||
|
public string Name => Language.Options_Changelog_Tab + "###tabs-changelog";
|
||||||
|
|
||||||
|
internal Changelog(Configuration mutable)
|
||||||
|
{
|
||||||
|
Mutable = mutable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Draw(bool changed)
|
||||||
|
{
|
||||||
|
using var wrap = ImGuiUtil.TextWrapPos();
|
||||||
|
|
||||||
|
ImGui.TextUnformatted(Language.Options_Warning_NotImplemented);
|
||||||
|
ImGuiUtil.OptionCheckbox(ref Mutable.PrintChangelog, Language.Options_PrintChangelog_Name, Language.Options_PrintChangelog_Description);
|
||||||
|
|
||||||
|
ImGui.Spacing();
|
||||||
|
ImGui.Separator();
|
||||||
|
ImGui.Spacing();
|
||||||
|
|
||||||
|
var changelog = Plugin.Interface.Manifest.Changelog;
|
||||||
|
if (changelog != null)
|
||||||
|
{
|
||||||
|
ImGui.TextUnformatted(Language.Options_Changelog_Header);
|
||||||
|
ImGui.TextUnformatted($"Version {Plugin.Interface.Manifest.AssemblyVersion.ToString(3)}");
|
||||||
|
ImGui.Spacing();
|
||||||
|
foreach (var sentence in changelog.Split("\n"))
|
||||||
|
{
|
||||||
|
if (sentence == string.Empty)
|
||||||
|
{
|
||||||
|
ImGui.NewLine();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var condition = sentence.StartsWith('-') || sentence.StartsWith(" -");
|
||||||
|
using var indent = ImRaii.PushIndent(10.0f, true, condition);
|
||||||
|
ImGui.TextUnformatted(sentence);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui.Spacing();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user