Changeset - 95e1ae426eb3
[Not reviewed]
default
0 4 0
Jason Maltzen - 12 months ago 2023-12-07 05:55:08
jason@hiddenachievement.com
Add an info box when a detected clipped reaction could be extrapolated from a white shift.
4 files changed with 21 insertions and 3 deletions:
0 comments (0 inline, 0 general)
Models/ReactionTest.cs
Show inline comments
...
 
@@ -83,4 +83,15 @@ namespace DesertPaintCodex.Models
 
        }
 

	
 
        private bool _whiteShift;
 
        public bool WhiteShift
 
        {
 
            get => _whiteShift;
 
            set
 
            {
 
                _whiteShift = value;
 
                NotifyPropertyChanged(nameof(WhiteShift));
 
            }
 
        }
 

	
 
        public bool IsAllCatalysts { get; }
 

	
...
 
@@ -153,5 +164,5 @@ namespace DesertPaintCodex.Models
 

	
 

	
 
        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;
...
 
@@ -160,4 +171,5 @@ namespace DesertPaintCodex.Models
 
            IsAllCatalysts = reagent1.IsCatalyst && reagent2.IsCatalyst;
 
            Clipped = clipType;
 
            WhiteShift = whiteShift;
 
            Reaction = reaction;
 
            State = (reaction != null) ? TestState.Saved :
...
 
@@ -254,4 +266,5 @@ namespace DesertPaintCodex.Models
 
                                if (!extrapolated) extrapolated = ExtrapolateWhiteFromOneChannel(_observedColor.Blue,  255, reaction.Blue);
 
                            }
 
                            WhiteShift = extrapolated;
 
                        }
 

	
Models/ReactionTestService.cs
Show inline comments
...
 
@@ -35,5 +35,5 @@ namespace DesertPaintCodex.Models
 
                    ClipType clipType = profile.PairClipStatus(reagent1, reagent2);
 
                    
 
                    ReactionTest test = new(reagent1, reagent2, reaction, clipType)
 
                    ReactionTest test = new(reagent1, reagent2, reaction, clipType, false)
 
                    {
 
                        Clipped  = clipType,
Util/Constants.cs
Show inline comments
...
 
@@ -22,5 +22,5 @@ namespace DesertPaintCodex.Util
 
                        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);
 
                }
 

	
Views/ReactionTestView.axaml
Show inline comments
...
 
@@ -135,4 +135,9 @@
 
            </StackPanel>
 

	
 
          <views:EmbeddedWarningBox Title="🛈 EXTRAPOLATED REACTION"
 
                                    IsVisible="{Binding ReactionTest.WhiteShift}"
 
                                    Message="One component of the reaction clipped, but a value could be extrapolated from the shift in the color components.">
 
          </views:EmbeddedWarningBox>
 

	
 
            <views:EmbeddedWarningBox Title="🛇 REACTION CLIPPED"
 
                                      IsVisible="{Binding !!ReactionTest.Clipped}"
0 comments (0 inline, 0 general)