Changeset - e53fa6e66029
[Not reviewed]
T9_V7 default
0 2 0
Jason Maltzen - 5 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 53 insertions and 0 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,4 +194,5 @@ 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,4 +262,6 @@ namespace DesertPaintLab
 
                reactionKnown = false;
 
                ingredient3ComboBox.Sensitive = false;
 
                recordNoReactionButton.Sensitive = recordEnabled;
 
                recordNoReactionButton.Visible = true;
 
            }
 
        
...
 
@@ -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;
 
                }
 
            }
...
 
@@ -560,4 +579,17 @@ 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
...
 
@@ -59,4 +59,6 @@ namespace DesertPaintLab
 
		private global::Gtk.Button recordButton;
 
		
 
        private global::Gtk.Button recordNoReactionButton;
 
		
 
		private global::Gtk.Label reactionLabel;
 

	
...
 
@@ -172,4 +174,16 @@ namespace DesertPaintLab
 
			w10.Fill = false;
 
			w10.Padding = ((uint)(6));
 
            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);
...
 
@@ -316,4 +330,5 @@ 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)