Changeset - e53fa6e66029
[Not reviewed]
T9_V7 default
0 2 0
Jason Maltzen - 4 years ago 2019-11-08 22:36:00
jason@hiddenachievement.com
Add a button for marking a reaction as 'no reaction'
2 files changed with 62 insertions and 9 deletions:
0 comments (0 inline, 0 general)
UI/CaptureView.cs
Show inline comments
...
 
@@ -81,4 +81,5 @@ namespace DesertPaintLab
 
            recordEnabled = false;
 
            recordButton.Sensitive = false;
 
            recordNoReactionButton.Sensitive = false;
 
        }
 

	
...
 
@@ -155,6 +156,9 @@ namespace DesertPaintLab
 
            isCaptured = false;
 
            recordButton.Sensitive = false;
 
            recordNoReactionButton.Sensitive = false;
 
            clearReactionButton.Sensitive = false;
 
            clearReactionButton.Visible = false;
 
            recordNoReactionButton.Sensitive = false;
 
            recordNoReactionButton.Visible = false;
 
    
 
            recipe.Clear();
...
 
@@ -168,4 +172,6 @@ namespace DesertPaintLab
 
                reactionSwatch.Clear();
 
                captureButton.Sensitive = false;
 
                recordNoReactionButton.Sensitive = false;
 
                recordNoReactionButton.Visible = false;
 
                return;
 
            }
...
 
@@ -177,4 +183,6 @@ namespace DesertPaintLab
 
                ingredient3ComboBox.Sensitive = false;
 
                recordButton.Sensitive = false;
 
                recordNoReactionButton.Sensitive = false;
 
                recordNoReactionButton.Visible = false;
 
                reactionKnown = false;
 
                reactionSwatch.Clear();
...
 
@@ -186,5 +194,6 @@ namespace DesertPaintLab
 
            ingredient3ComboBox.Sensitive = true;
 
            captureButton.Sensitive = true;
 
            
 
            recordNoReactionButton.Sensitive = true;
 

	
 
            reaction1 = profile.FindReaction(reagents[0], reagents[1]);
 
            
...
 
@@ -195,8 +204,12 @@ namespace DesertPaintLab
 
                clearReactionButton.Visible = true;
 
                ingredient3ComboBox.Sensitive = true;
 
                recordNoReactionButton.Sensitive = false;
 
                recordNoReactionButton.Visible = false;
 
                if ((reagentName = GetSelectedReagentName(3)) != null)
 
                {
 
                    clearReactionButton.Sensitive = false;
 
                    clearReactionButton.Visible = false;
 
                    recordNoReactionButton.Sensitive = false;
 
                    recordNoReactionButton.Visible = false;
 
                    recipe.AddReagent(reagentName);
 
                    reagents[2] = ReagentManager.GetReagent(reagentName);
...
 
@@ -249,6 +262,8 @@ namespace DesertPaintLab
 
                reactionKnown = false;
 
                ingredient3ComboBox.Sensitive = false;
 
                recordNoReactionButton.Sensitive = recordEnabled;
 
                recordNoReactionButton.Visible = true;
 
            }
 
        
 

 
            expectedColor.Set(recipe.BaseColor);
 
            unmodifiedSwatch.Color = expectedColor;
...
 
@@ -273,7 +288,9 @@ namespace DesertPaintLab
 
            ingredient3ComboBox.Sensitive = false;
 
            clearReactionButton.Sensitive = false;
 
            recordNoReactionButton.Sensitive = false;
 

	
 
            progressBar.Show();
 
            recordButton.Hide();
 
            recordNoReactionButton.Hide();
 

	
 
            bool enableDebugMenu;
...
 
@@ -429,8 +446,10 @@ namespace DesertPaintLab
 
                    // reaction clipped - don't let them record
 
                    recordButton.Sensitive = false;
 
                    recordNoReactionButton.Sensitive = false;
 
                }
 
                else
 
                {
 
                    recordButton.Sensitive = recordEnabled;
 
                    recordNoReactionButton.Sensitive = false;
 
                }
 
            }
...
 
@@ -559,5 +578,18 @@ namespace DesertPaintLab
 
            }
 
        }
 
        
 

	
 
        protected virtual void OnRecordNoReaction(object sender, System.EventArgs e)
 
        {
 
            if (ReactionRecorder.Instance.RecordReaction(profile, expectedColor, expectedColor, reagents))
 
            {
 
                recordNoReactionButton.Sensitive = false;
 
                recordNoReactionButton.Visible = false;
 
                clearReactionButton.Sensitive = true;
 
                clearReactionButton.Visible = true;
 
                this.reactionSwatch.Color = expectedColor;
 
                this.reactedColor.Set(expectedColor);
 
            }
 
        }
 

	
 
        protected virtual void OnChangedIngredient1(object sender, System.EventArgs e)
 
        {
...
 
@@ -601,4 +633,10 @@ namespace DesertPaintLab
 
                        // really delete it
 
                        profile.ClearReaction(reagent1, reagent2);
 
                        reactionSwatch.Clear();
 
                        reactedColor.Clear();
 
                        clearReactionButton.Sensitive = false;
 
                        clearReactionButton.Visible = false;
 
                        recordNoReactionButton.Sensitive = true;
 
                        recordNoReactionButton.Visible = true;
 
                    }
 
                    md.Destroy();
gtk-gui/DesertPaintLab.CaptureView.cs
Show inline comments
...
 
@@ -58,4 +58,6 @@ namespace DesertPaintLab
 
		
 
		private global::Gtk.Button recordButton;
 

	
 
        private global::Gtk.Button recordNoReactionButton;
 
		
 
		private global::Gtk.Label reactionLabel;
...
 
@@ -158,6 +160,6 @@ namespace DesertPaintLab
 
			w9.Expand = false;
 
			w9.Fill = false;
 
			// Container child vbox2.Gtk.Box+BoxChild
 
			this.clearReactionButton = new global::Gtk.Button ();
 
            // Container child vbox2.Gtk.Box+BoxChild
 
            this.clearReactionButton = new global::Gtk.Button ();
 
			this.clearReactionButton.Sensitive = false;
 
			this.clearReactionButton.CanFocus = true;
...
 
@@ -172,5 +174,17 @@ namespace DesertPaintLab
 
			w10.Fill = false;
 
			w10.Padding = ((uint)(6));
 
			this.GtkAlignment.Add (this.vbox2);
 
            this.recordNoReactionButton = new global::Gtk.Button();
 
            this.recordNoReactionButton.CanFocus = true;
 
            this.recordNoReactionButton.Name = "recordNoReactionButton";
 
            this.recordNoReactionButton.UseUnderline = true;
 
            this.recordNoReactionButton.Label = "No Reaction";
 
            this.vbox2.Add(this.recordNoReactionButton);
 
            global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.recordNoReactionButton]));
 
            w21.PackType = ((global::Gtk.PackType)(1));
 
            w21.Position = 4;
 
            w21.Expand = false;
 
            w21.Fill = false;
 
            w21.Padding = ((uint)(6));
 
            this.GtkAlignment.Add (this.vbox2);
 
			this.selectIngredientsFrame.Add (this.GtkAlignment);
 
			this.selectIngredientsLabel = new global::Gtk.Label ();
...
 
@@ -289,5 +303,5 @@ namespace DesertPaintLab
 
			w20.Expand = false;
 
			w20.Fill = false;
 
			this.GtkAlignment2.Add (this.vbox4);
 
            this.GtkAlignment2.Add (this.vbox4);
 
			this.reactedColorFrame.Add (this.GtkAlignment2);
 
			this.reactionLabel = new global::Gtk.Label ();
...
 
@@ -316,5 +330,6 @@ namespace DesertPaintLab
 
            this.captureFromFileButton.Clicked += new global::System.EventHandler(this.OnCaptureFromFile);
 
            this.recordButton.Clicked += new global::System.EventHandler (this.OnRecord);
 
		}
 
	}
 
            this.recordNoReactionButton.Clicked += new global::System.EventHandler(this.OnRecordNoReaction);
 
        }
 
    }
 
}
0 comments (0 inline, 0 general)