# HG changeset patch # User Jason Maltzen # Date 2023-12-07 05:55:08 # Node ID 95e1ae426eb39e04b74ebc8ae7e5918bcf49d95d # Parent abff9027c6124402cfc7f5eebe1b3c37c778c406 Add an info box when a detected clipped reaction could be extrapolated from a white shift. diff --git a/Models/ReactionTest.cs b/Models/ReactionTest.cs --- a/Models/ReactionTest.cs +++ b/Models/ReactionTest.cs @@ -82,6 +82,17 @@ namespace DesertPaintCodex.Models } } + private bool _whiteShift; + public bool WhiteShift + { + get => _whiteShift; + set + { + _whiteShift = value; + NotifyPropertyChanged(nameof(WhiteShift)); + } + } + public bool IsAllCatalysts { get; } private Reaction? _reaction; @@ -152,13 +163,14 @@ namespace DesertPaintCodex.Models public bool IsStub { get; } - public ReactionTest(Reagent reagent1, Reagent reagent2, Reaction? reaction, ClipType clipType, bool isStub = false) + public ReactionTest(Reagent reagent1, Reagent reagent2, Reaction? reaction, ClipType clipType, bool whiteShift, bool isStub = false) { Reagent1 = reagent1; Reagent2 = reagent2; UseFirstBuffer = true; IsAllCatalysts = reagent1.IsCatalyst && reagent2.IsCatalyst; Clipped = clipType; + WhiteShift = whiteShift; Reaction = reaction; State = (reaction != null) ? TestState.Saved : (clipType == ClipType.None) ? TestState.Untested : TestState.ClippedResult; @@ -253,6 +265,7 @@ namespace DesertPaintCodex.Models if (!extrapolated) extrapolated = ExtrapolateWhiteFromOneChannel(_observedColor.Green, 255, reaction.Green); if (!extrapolated) extrapolated = ExtrapolateWhiteFromOneChannel(_observedColor.Blue, 255, reaction.Blue); } + WhiteShift = extrapolated; } if (!extrapolated) diff --git a/Models/ReactionTestService.cs b/Models/ReactionTestService.cs --- a/Models/ReactionTestService.cs +++ b/Models/ReactionTestService.cs @@ -34,7 +34,7 @@ namespace DesertPaintCodex.Models Reaction? reaction = profile.FindReaction(reagent1, reagent2); ClipType clipType = profile.PairClipStatus(reagent1, reagent2); - ReactionTest test = new(reagent1, reagent2, reaction, clipType) + ReactionTest test = new(reagent1, reagent2, reaction, clipType, false) { Clipped = clipType, Reaction = reaction, diff --git a/Util/Constants.cs b/Util/Constants.cs --- a/Util/Constants.cs +++ b/Util/Constants.cs @@ -21,7 +21,7 @@ namespace DesertPaintCodex.Util _stubReactionTest = new ReactionTest( new Reagent("Toad Skin", "ToadSkin", 48, 96, 48, 0), new Reagent("Falcons Bait", "FalconBait", 128, 240, 224, 1), - null, ClipType.None, true); + null, ClipType.None, false, true); } return _stubReactionTest; diff --git a/Views/ReactionTestView.axaml b/Views/ReactionTestView.axaml --- a/Views/ReactionTestView.axaml +++ b/Views/ReactionTestView.axaml @@ -134,6 +134,11 @@ + + +