add toggle to hide server info messages

This commit is contained in:
rootdarkarchon
2023-01-04 23:54:01 +01:00
parent 49913a498e
commit 7e87dc61e7
4 changed files with 17 additions and 5 deletions

View File

@@ -79,6 +79,7 @@ public class Configuration : IPluginConfiguration
public bool InitialScanComplete { get; set; } = false;
public bool FullPause { get; set; } = false;
public bool HideInfoMessages { get; set; } = false;
public Dictionary<string, Dictionary<string, string>> UidServerComments { get; set; } = new(StringComparer.Ordinal);
public Dictionary<string, Dictionary<string, string>> GidServerComments { get; set; } = new(StringComparer.Ordinal);

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<Authors></Authors>
<Company></Company>
<Version>0.5.22</Version>
<Version>0.5.23</Version>
<Description></Description>
<Copyright></Copyright>
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>

View File

@@ -27,6 +27,7 @@ public class SettingsUi : Window, IDisposable
private bool? _notesSuccessfullyApplied = null;
private string _lastTab = string.Empty;
private bool _openPopupOnAddition;
private bool _hideInfoMessages;
public SettingsUi(WindowSystem windowSystem,
UiShared uiShared, Configuration configuration, ApiController apiController) : base("Mare Synchronos Settings")
@@ -44,6 +45,7 @@ public class SettingsUi : Window, IDisposable
_apiController = apiController;
_uiShared = uiShared;
_openPopupOnAddition = _configuration.OpenPopupOnAdd;
_hideInfoMessages = _configuration.HideInfoMessages;
windowSystem.AddWindow(this);
}
@@ -163,6 +165,12 @@ public class SettingsUi : Window, IDisposable
_configuration.Save();
}
UiShared.DrawHelpText("This will open a popup that allows you to set the notes for a user after successfully adding them to your individual pairs.");
if (ImGui.Checkbox("Hide Server Info Messages", ref _hideInfoMessages))
{
_configuration.HideInfoMessages = _hideInfoMessages;
_configuration.Save();
}
UiShared.DrawHelpText("Enabling this will not print any \"Info\" labeled messages into the game chat.");
}
private void DrawAdministration()
@@ -442,7 +450,7 @@ public class SettingsUi : Window, IDisposable
var buttonSize = (ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X -
ImGui.GetStyle().ItemSpacing.X) / 2;
if (ImGui.Button("Delete everything", new Vector2(buttonSize, 0)))
{
Task.Run(() => _apiController.FilesDeleteAll());
@@ -476,10 +484,10 @@ public class SettingsUi : Window, IDisposable
ImGui.Text("Are you sure you want to continue?");
ImGui.Separator();
ImGui.Spacing();
var buttonSize = (ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X -
ImGui.GetStyle().ItemSpacing.X) / 2;
if (ImGui.Button("Delete account", new Vector2(buttonSize, 0)))
{
Task.Run(() => _apiController.UserDelete());

View File

@@ -234,7 +234,10 @@ public partial class ApiController
break;
case MessageSeverity.Information:
Logger.Info(message);
_dalamudUtil.PrintInfoChat(message);
if (!_pluginConfiguration.HideInfoMessages)
{
_dalamudUtil.PrintInfoChat(message);
}
break;
}