Disable pair analysis in Release mode

This commit is contained in:
Loporrit
2025-02-23 12:20:50 +00:00
parent 99eecbdc09
commit 250f61ad85
3 changed files with 8 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ public sealed class PairAnalyzer : DisposableMediatorSubscriberBase
: base(logger, mediator) : base(logger, mediator)
{ {
Pair = pair; Pair = pair;
#if DEBUG
Mediator.SubscribeKeyed<PairDataAppliedMessage>(this, pair.UserData.UID, (msg) => Mediator.SubscribeKeyed<PairDataAppliedMessage>(this, pair.UserData.UID, (msg) =>
{ {
_baseAnalysisCts = _baseAnalysisCts.CancelRecreate(); _baseAnalysisCts = _baseAnalysisCts.CancelRecreate();
@@ -36,12 +37,15 @@ public sealed class PairAnalyzer : DisposableMediatorSubscriberBase
_lastDataHash = string.Empty; _lastDataHash = string.Empty;
} }
}); });
#endif
_fileCacheManager = fileCacheManager; _fileCacheManager = fileCacheManager;
_xivDataAnalyzer = modelAnalyzer; _xivDataAnalyzer = modelAnalyzer;
#if DEBUG
var lastReceivedData = pair.LastReceivedCharacterData; var lastReceivedData = pair.LastReceivedCharacterData;
if (lastReceivedData != null) if (lastReceivedData != null)
_ = BaseAnalysis(lastReceivedData, _baseAnalysisCts.Token); _ = BaseAnalysis(lastReceivedData, _baseAnalysisCts.Token);
#endif
} }
public Pair Pair { get; init; } public Pair Pair { get; init; }

View File

@@ -335,11 +335,13 @@ public class DrawGroupPair : DrawPairBase
} }
if (_pair.IsVisible) if (_pair.IsVisible)
{ {
#if DEBUG
if (_uiSharedService.IconTextButton(FontAwesomeIcon.PersonCircleQuestion, "Open Analysis")) if (_uiSharedService.IconTextButton(FontAwesomeIcon.PersonCircleQuestion, "Open Analysis"))
{ {
_displayHandler.OpenAnalysis(_pair); _displayHandler.OpenAnalysis(_pair);
ImGui.CloseCurrentPopup(); ImGui.CloseCurrentPopup();
} }
#endif
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Sync, "Reload last data")) if (_uiSharedService.IconTextButton(FontAwesomeIcon.Sync, "Reload last data"))
{ {
_pair.ApplyLastReceivedData(forced: true); _pair.ApplyLastReceivedData(forced: true);

View File

@@ -225,11 +225,13 @@ public class DrawUserPair : DrawPairBase
} }
if (entry.IsVisible) if (entry.IsVisible)
{ {
#if DEBUG
if (_uiSharedService.IconTextButton(FontAwesomeIcon.PersonCircleQuestion, "Open Analysis")) if (_uiSharedService.IconTextButton(FontAwesomeIcon.PersonCircleQuestion, "Open Analysis"))
{ {
_displayHandler.OpenAnalysis(_pair); _displayHandler.OpenAnalysis(_pair);
ImGui.CloseCurrentPopup(); ImGui.CloseCurrentPopup();
} }
#endif
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Sync, "Reload last data")) if (_uiSharedService.IconTextButton(FontAwesomeIcon.Sync, "Reload last data"))
{ {
entry.ApplyLastReceivedData(forced: true); entry.ApplyLastReceivedData(forced: true);