Allow disable display self-analysis alert

This commit is contained in:
2025-11-01 00:23:53 +01:00
parent 89fa1a999f
commit e1d71ee33a
7 changed files with 27 additions and 5 deletions

View File

@@ -8,9 +8,10 @@ public class PlayerPerformanceConfig : IMareConfiguration
public bool AutoPausePlayersExceedingThresholds { get; set; } = true; public bool AutoPausePlayersExceedingThresholds { get; set; } = true;
public bool NotifyAutoPauseDirectPairs { get; set; } = true; public bool NotifyAutoPauseDirectPairs { get; set; } = true;
public bool NotifyAutoPauseGroupPairs { get; set; } = true; public bool NotifyAutoPauseGroupPairs { get; set; } = true;
public bool ShowSelfAnalysisWarnings { get; set; } = true;
public int VRAMSizeAutoPauseThresholdMiB { get; set; } = 500; public int VRAMSizeAutoPauseThresholdMiB { get; set; } = 500;
public int TrisAutoPauseThresholdThousands { get; set; } = 400; public int TrisAutoPauseThresholdThousands { get; set; } = 400;
public bool IgnoreDirectPairs { get; set; } = true; public bool IgnoreDirectPairs { get; set; } = true;
public TextureShrinkMode TextureShrinkMode { get; set; } = TextureShrinkMode.Default; public TextureShrinkMode TextureShrinkMode { get; set; } = TextureShrinkMode.Default;
public bool TextureShrinkDeleteOriginal { get; set; } = false; public bool TextureShrinkDeleteOriginal { get; set; } = false;
} }

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<AssemblyName>UmbraSync</AssemblyName> <AssemblyName>UmbraSync</AssemblyName>
<RootNamespace>UmbraSync</RootNamespace> <RootNamespace>UmbraSync</RootNamespace>
<Version>0.1.9.5</Version> <Version>0.1.9.6</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -3,6 +3,7 @@ using Lumina.Data.Files;
using MareSynchronos.API.Data; using MareSynchronos.API.Data;
using MareSynchronos.API.Data.Enum; using MareSynchronos.API.Data.Enum;
using MareSynchronos.FileCache; using MareSynchronos.FileCache;
using MareSynchronos.MareConfiguration;
using MareSynchronos.MareConfiguration.Models; using MareSynchronos.MareConfiguration.Models;
using MareSynchronos.Services.Mediator; using MareSynchronos.Services.Mediator;
using MareSynchronos.UI; using MareSynchronos.UI;
@@ -15,6 +16,7 @@ public sealed class CharacterAnalyzer : DisposableMediatorSubscriberBase
{ {
private readonly FileCacheManager _fileCacheManager; private readonly FileCacheManager _fileCacheManager;
private readonly XivDataAnalyzer _xivDataAnalyzer; private readonly XivDataAnalyzer _xivDataAnalyzer;
private readonly PlayerPerformanceConfigService _playerPerformanceConfigService;
private CancellationTokenSource? _analysisCts; private CancellationTokenSource? _analysisCts;
private CancellationTokenSource _baseAnalysisCts = new(); private CancellationTokenSource _baseAnalysisCts = new();
private string _lastDataHash = string.Empty; private string _lastDataHash = string.Empty;
@@ -29,7 +31,7 @@ public sealed class CharacterAnalyzer : DisposableMediatorSubscriberBase
private bool _sizeWarningShown; private bool _sizeWarningShown;
private bool _triangleWarningShown; private bool _triangleWarningShown;
public CharacterAnalyzer(ILogger<CharacterAnalyzer> logger, MareMediator mediator, FileCacheManager fileCacheManager, XivDataAnalyzer modelAnalyzer) public CharacterAnalyzer(ILogger<CharacterAnalyzer> logger, MareMediator mediator, FileCacheManager fileCacheManager, XivDataAnalyzer modelAnalyzer, PlayerPerformanceConfigService playerPerformanceConfigService)
: base(logger, mediator) : base(logger, mediator)
{ {
Mediator.Subscribe<CharacterDataCreatedMessage>(this, (msg) => Mediator.Subscribe<CharacterDataCreatedMessage>(this, (msg) =>
@@ -40,6 +42,7 @@ public sealed class CharacterAnalyzer : DisposableMediatorSubscriberBase
}); });
_fileCacheManager = fileCacheManager; _fileCacheManager = fileCacheManager;
_xivDataAnalyzer = modelAnalyzer; _xivDataAnalyzer = modelAnalyzer;
_playerPerformanceConfigService = playerPerformanceConfigService;
} }
public int CurrentFile { get; internal set; } public int CurrentFile { get; internal set; }
@@ -315,6 +318,12 @@ public sealed class CharacterAnalyzer : DisposableMediatorSubscriberBase
return; return;
} }
if (!_playerPerformanceConfigService.Current.ShowSelfAnalysisWarnings)
{
ResetThresholdFlagsIfNeeded(summary);
return;
}
bool sizeExceeded = summary.TotalCompressedSize >= NotificationSizeThreshold; bool sizeExceeded = summary.TotalCompressedSize >= NotificationSizeThreshold;
bool trianglesExceeded = summary.TotalTriangles >= NotificationTriangleThreshold; bool trianglesExceeded = summary.TotalTriangles >= NotificationTriangleThreshold;
List<string> exceededReasons = new(); List<string> exceededReasons = new();

View File

@@ -169,6 +169,10 @@ public sealed class ChangelogUi : WindowMediatorSubscriberBase
{ {
return new List<ChangelogEntry> return new List<ChangelogEntry>
{ {
new(new Version(0, 1, 9, 6), "0.1.9.6", new List<ChangelogLine>
{
new("Possibilité de désactiver l'alerte self-analysis (Settings => Performance)."),
}),
new(new Version(0, 1, 9, 5), "0.1.9.5", new List<ChangelogLine> new(new Version(0, 1, 9, 5), "0.1.9.5", new List<ChangelogLine>
{ {
new("Fix l'affichage de la bulle dans la liste du groupe."), new("Fix l'affichage de la bulle dans la liste du groupe."),

View File

@@ -1328,6 +1328,14 @@ public class SettingsUi : WindowMediatorSubscriberBase
_uiShared.BigText("Global Configuration"); _uiShared.BigText("Global Configuration");
bool showSelfAnalysisWarnings = _playerPerformanceConfigService.Current.ShowSelfAnalysisWarnings;
if (ImGui.Checkbox("Display self-analysis warnings", ref showSelfAnalysisWarnings))
{
_playerPerformanceConfigService.Current.ShowSelfAnalysisWarnings = showSelfAnalysisWarnings;
_playerPerformanceConfigService.Save();
}
_uiShared.DrawHelpText("Disable to suppress UmbraSync chat warnings when your character exceeds the self-analysis thresholds.");
bool alwaysShrinkTextures = _playerPerformanceConfigService.Current.TextureShrinkMode == TextureShrinkMode.Always; bool alwaysShrinkTextures = _playerPerformanceConfigService.Current.TextureShrinkMode == TextureShrinkMode.Always;
bool deleteOriginalTextures = _playerPerformanceConfigService.Current.TextureShrinkDeleteOriginal; bool deleteOriginalTextures = _playerPerformanceConfigService.Current.TextureShrinkDeleteOriginal;