feat: add an option to hide redundant timestamps
This commit is contained in:
parent
04783fcf02
commit
048826baed
@ -19,6 +19,7 @@ internal class Configuration : IPluginConfiguration {
|
||||
public bool NativeItemTooltips = true;
|
||||
public bool PrettierTimestamps = true;
|
||||
public bool MoreCompactPretty;
|
||||
public bool HideSameTimestamps;
|
||||
public bool ShowNoviceNetwork;
|
||||
public bool SidebarTabView;
|
||||
public CommandHelpSide CommandHelpSide = CommandHelpSide.None;
|
||||
@ -50,6 +51,7 @@ internal class Configuration : IPluginConfiguration {
|
||||
this.NativeItemTooltips = other.NativeItemTooltips;
|
||||
this.PrettierTimestamps = other.PrettierTimestamps;
|
||||
this.MoreCompactPretty = other.MoreCompactPretty;
|
||||
this.HideSameTimestamps = other.HideSameTimestamps;
|
||||
this.ShowNoviceNetwork = other.ShowNoviceNetwork;
|
||||
this.SidebarTabView = other.SidebarTabView;
|
||||
this.CommandHelpSide = other.CommandHelpSide;
|
||||
|
18
ChatTwo/Resources/Language.Designer.cs
generated
18
ChatTwo/Resources/Language.Designer.cs
generated
@ -564,6 +564,24 @@ namespace ChatTwo.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Hide timestamps when previous messages have the same timestamp..
|
||||
/// </summary>
|
||||
internal static string Options_HideSameTimestamps_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_HideSameTimestamps_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Hide timestamps when redundant.
|
||||
/// </summary>
|
||||
internal static string Options_HideSameTimestamps_Name {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_HideSameTimestamps_Name", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Hide {0} when you are not logged in to a character..
|
||||
/// </summary>
|
||||
|
@ -476,4 +476,10 @@
|
||||
<data name="ChatLog_Tabs_PopOut" xml:space="preserve">
|
||||
<value>Pop out</value>
|
||||
</data>
|
||||
<data name="Options_HideSameTimestamps_Name" xml:space="preserve">
|
||||
<value>Hide timestamps when redundant</value>
|
||||
</data>
|
||||
<data name="Options_HideSameTimestamps_Description" xml:space="preserve">
|
||||
<value>Hide timestamps when previous messages have the same timestamp.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
@ -623,6 +623,7 @@ internal sealed class ChatLog : IUiComponent {
|
||||
}
|
||||
|
||||
var lastPos = ImGui.GetCursorPosY();
|
||||
var lastTimestamp = string.Empty;
|
||||
foreach (var message in tab.Messages) {
|
||||
if (reset) {
|
||||
message.Height = null;
|
||||
@ -663,7 +664,10 @@ internal sealed class ChatLog : IUiComponent {
|
||||
if (tab.DisplayTimestamp) {
|
||||
var timestamp = message.Date.ToLocalTime().ToString("t");
|
||||
if (table) {
|
||||
ImGui.TextUnformatted(timestamp);
|
||||
if (!this.Ui.Plugin.Config.HideSameTimestamps || timestamp != lastTimestamp) {
|
||||
ImGui.TextUnformatted(timestamp);
|
||||
lastTimestamp = timestamp;
|
||||
}
|
||||
} else {
|
||||
this.DrawChunk(new TextChunk(ChunkSource.None, null, $"[{timestamp}]") {
|
||||
Foreground = 0xFFFFFFFF,
|
||||
|
@ -59,6 +59,7 @@ internal sealed class Display : ISettingsTab {
|
||||
if (this.Mutable.PrettierTimestamps) {
|
||||
ImGui.TreePush();
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.MoreCompactPretty, Language.Options_MoreCompactPretty_Name, Language.Options_MoreCompactPretty_Description);
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.HideSameTimestamps, Language.Options_HideSameTimestamps_Name, Language.Options_HideSameTimestamps_Description);
|
||||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user