Add option to limit the amount of shown log lines
This commit is contained in:
@@ -874,7 +874,11 @@ public sealed class ChatLogWindow : Window, IUiComponent
|
||||
var lastTimestamp = string.Empty;
|
||||
int? lastMessageHash = null;
|
||||
var sameCount = 0;
|
||||
for (var i = 0; i < tab.Messages.Count; i++)
|
||||
|
||||
int maxLines = Plugin.Config.MaxLinesToRender;
|
||||
int startLine = tab.Messages.Count > maxLines ? tab.Messages.Count - maxLines : 0;
|
||||
|
||||
for (int i = startLine; i < tab.Messages.Count; i++)
|
||||
{
|
||||
var message = tab.Messages[i];
|
||||
|
||||
|
||||
@@ -87,6 +87,12 @@ internal sealed class Display : ISettingsTab {
|
||||
ImGuiUtil.DragFloatVertical(Language.Options_WindowOpacity_Name, ref Mutable.WindowAlpha, .25f, 0f, 100f, $"{Mutable.WindowAlpha:N2}%%", ImGuiSliderFlags.AlwaysClamp);
|
||||
ImGui.Spacing();
|
||||
|
||||
|
||||
if (ImGuiUtil.InputIntVertical(Language.Options_MaxLinesToShow_Name, Language.Options_MaxLinesToShow_Description, ref Mutable.MaxLinesToRender)) {
|
||||
Mutable.MaxLinesToRender = Math.Clamp(Mutable.MaxLinesToRender, 1, 10_000);
|
||||
}
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref Mutable.CanMove, Language.Options_CanMove_Name);
|
||||
ImGui.Spacing();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user