Changeset - 41381c24d35a
[Not reviewed]
default
0 13 1
Jason Maltzen - 6 years ago 2018-05-15 15:35:12
jason@hiddenachievement.com
Now supports all the interface sizes with a setting to select the current interface size. The initial screen size check now displays the detected resolution as a hint. The screen size check / interface size settings can now be updated after launch through File->Preferences. Capturing a reaction now includes a progress bar, and runs in a separate thread instead of silently blocking. The reaction status window under 'Help' now has options to disable ingredients to remove them from the list. NOTE: this also disables/enables those ingredients in the recipe generator as well. The list also updates as new reactions are recorded instead of requiring that it be closed and re-opened to update.
14 files changed with 771 insertions and 144 deletions:
0 comments (0 inline, 0 general)
DesertPaintLab.csproj
Show inline comments
...
 
@@ -10,2 +10,3 @@
 
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
 
    <IsWebBootstrapper>false</IsWebBootstrapper>
 
    <PublishUrl>publish\</PublishUrl>
...
 
@@ -20,5 +21,5 @@
 
    <MapFileExtensions>true</MapFileExtensions>
 
    <AutorunEnabled>true</AutorunEnabled>
 
    <ApplicationRevision>0</ApplicationRevision>
 
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
 
    <IsWebBootstrapper>false</IsWebBootstrapper>
 
    <UseApplicationTrust>false</UseApplicationTrust>
...
 
@@ -84,2 +85,3 @@
 
  <ItemGroup>
 
    <Compile Include="InterfaceSize.cs" />
 
    <Compile Include="gtk-gui\generated.cs" />
InterfaceSize.cs
Show inline comments
 
new file 100644
 
/*
 
 * Copyright (c) 2015, Jason Maltzen
 

	
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 
 of this software and associated documentation files (the "Software"), to deal
 
 in the Software without restriction, including without limitation the rights
 
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
 copies of the Software, and to permit persons to whom the Software is
 
 furnished to do so, subject to the following conditions:
 

	
 
 The above copyright notice and this permission notice shall be included in
 
 all copies or substantial portions of the Software.
 

	
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
 THE SOFTWARE.
 
*/
 

	
 
namespace DesertPaintLab
 
{
 
    public enum InterfaceSize
 
    {
 
        Tiny = 0,
 
        Small = 1,
 
        Medium = 2,
 
        Large = 3,
 
        Huge = 4
 
    }
 
}
...
 
\ No newline at end of file
MainWindow.cs
Show inline comments
...
 
@@ -46,2 +46,4 @@ public partial class MainWindow : Gtk.Wi
 

	
 
    private ReactionStatusWindow _reactionStatusWindow;
 

	
 
	public bool ShouldShutDown
...
 
@@ -108,15 +110,5 @@ public partial class MainWindow : Gtk.Wi
 
		// get its width and height
 
        int detectedScreenWidth;
 
        int detectedScreenHeight;
 
		rootWindow.GetSize(out detectedScreenWidth, out detectedScreenHeight);
 
        int screenWidth = detectedScreenWidth;
 
        int screenHeight = detectedScreenHeight;
 
        int pixelMultiplier = 1;
 
        DesertPaintLab.AppSettings.Load();
 

	
 
        if ( DesertPaintLab.AppSettings.Load() == true )
 
        {
 
            DesertPaintLab.AppSettings.Get("ScreenWidth", out screenWidth);
 
            DesertPaintLab.AppSettings.Get("ScreenHeight", out screenHeight);
 
            DesertPaintLab.AppSettings.Get("PixelMultiplier", out pixelMultiplier);
 
        }
 
        ShowPreferencesDialog();
 

	
...
 
@@ -126,22 +118,3 @@ public partial class MainWindow : Gtk.Wi
 

	
 
		ScreenCheckDialog screenCheckDialog = new ScreenCheckDialog();
 
        // TODO: screenCheckDialog.DetectedWidth = detectedScreenWidth;
 
        // TODO: screenCheckDialog.DetectedHeight = detectedScreenHeight;
 
		screenCheckDialog.ScreenWidth = screenWidth;
 
		screenCheckDialog.ScreenHeight = screenHeight;
 
        screenCheckDialog.GamePixelWidth = pixelMultiplier;
 
		ResponseType resp = (ResponseType)screenCheckDialog.Run();
 
        screenWidth = screenCheckDialog.ScreenWidth;
 
        screenHeight = screenCheckDialog.ScreenHeight;
 
        pixelMultiplier = screenCheckDialog.GamePixelWidth;
 
		screenCheckDialog.Destroy();
 

	
 
        DesertPaintLab.AppSettings.Set("ScreenWidth", screenWidth);
 
        DesertPaintLab.AppSettings.Set("ScreenHeight", screenHeight);
 
        DesertPaintLab.AppSettings.Set("PixelMultiplier", pixelMultiplier);
 
        DesertPaintLab.AppSettings.Save();
 

	
 
		screenBuffer = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, false, 8, screenWidth, screenHeight);
 
	
 
        ReactionRecorder.Instance.SetPixelMultiplier(pixelMultiplier);
 
        ReactionRecorder.Instance.OnReactionRecorded += OnReactionRecorded;
 

	
...
 
@@ -152,2 +125,4 @@ public partial class MainWindow : Gtk.Wi
 

	
 
        if (!shouldShutDown)
 
        {
 
        captureView = new CaptureView(profile, screenBuffer);
...
 
@@ -162,2 +137,3 @@ public partial class MainWindow : Gtk.Wi
 
	}
 
    }
 

	
...
 
@@ -501,6 +477,21 @@ public partial class MainWindow : Gtk.Wi
 

	
 
    protected void OnReactionRecorded(Reagent reagent1, Reagent reagent2, Reaction reaction)
 
    {
 
        if (_reactionStatusWindow != null)
 
        {
 
            _reactionStatusWindow.RefreshReactions();
 
        }
 
    }
 

	
 
    protected void OnReactionStatusDestroyed(object o, EventArgs args)
 
    {
 
        _reactionStatusWindow = null;
 
    }
 

	
 
    protected void OnShowReactionStatus(object sender, EventArgs e)
 
    {
 
        ReactionStatusWindow win = new ReactionStatusWindow(profile);
 
        win.Show();
 
        if (_reactionStatusWindow != null) return; // already open
 
        _reactionStatusWindow = new ReactionStatusWindow(profile);
 
        _reactionStatusWindow.Destroyed += new EventHandler(OnReactionStatusDestroyed);
 
        _reactionStatusWindow.Show();
 
    }
...
 
@@ -723,3 +714,63 @@ public partial class MainWindow : Gtk.Wi
 
    }
 

	
 
    protected void ShowPreferencesDialog()
 
    {
 
        int detectedScreenWidth;
 
        int detectedScreenHeight;
 
        rootWindow.GetSize(out detectedScreenWidth, out detectedScreenHeight);
 
        int screenWidth = detectedScreenWidth;
 
        int screenHeight = detectedScreenHeight;
 
        int pixelMultiplier = 1;
 
        int interfaceSizeIndex = (int)(InterfaceSize.Small);
 

	
 
        DesertPaintLab.AppSettings.Get("ScreenWidth", out screenWidth);
 
        DesertPaintLab.AppSettings.Get("ScreenHeight", out screenHeight);
 
        DesertPaintLab.AppSettings.Get("PixelMultiplier", out pixelMultiplier);
 
        DesertPaintLab.AppSettings.Get("InterfaceSize", out interfaceSizeIndex);
 
        InterfaceSize interfaceSize = (InterfaceSize)interfaceSizeIndex;
 

	
 
        ScreenCheckDialog screenCheckDialog = new ScreenCheckDialog();
 
        screenCheckDialog.DetectedScreenWidth = detectedScreenWidth;
 
        screenCheckDialog.DetectedScreenHeight = detectedScreenHeight;
 
        screenCheckDialog.ScreenWidth = screenWidth;
 
        screenCheckDialog.ScreenHeight = screenHeight;
 
        screenCheckDialog.GamePixelWidth = pixelMultiplier;
 
        screenCheckDialog.InterfaceSize = interfaceSize;
 

	
 
        ResponseType resp = (ResponseType)screenCheckDialog.Run();
 

	
 
        screenWidth = screenCheckDialog.ScreenWidth;
 
        screenHeight = screenCheckDialog.ScreenHeight;
 
        pixelMultiplier = screenCheckDialog.GamePixelWidth;
 
        interfaceSize = screenCheckDialog.InterfaceSize;
 
        screenCheckDialog.Destroy();
 

	
 
        DesertPaintLab.AppSettings.Set("ScreenWidth", screenWidth);
 
        DesertPaintLab.AppSettings.Set("ScreenHeight", screenHeight);
 
        DesertPaintLab.AppSettings.Set("PixelMultiplier", pixelMultiplier);
 
        DesertPaintLab.AppSettings.Set("InterfaceSize", (int)interfaceSize);
 
        DesertPaintLab.AppSettings.Save();
 

	
 
        screenBuffer = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, false, 8, screenWidth, screenHeight);
 

	
 
        ReactionRecorder.Instance.SetPixelMultiplier(pixelMultiplier);
 
        ReactionRecorder.Instance.SetInterfaceSize(interfaceSize);
 
}
 

	
 
    protected void OnPreferences(object sender, EventArgs e)
 
    {
 
        ShowPreferencesDialog();
 

	
 
        int screenWidth = 1920;
 
        int screenHeight = 1080;
 
        int pixelMultiplier = 1;
 
        int interfaceSizeIndex = (int)(InterfaceSize.Small);
 

	
 
        DesertPaintLab.AppSettings.Get("ScreenWidth", out screenWidth);
 
        DesertPaintLab.AppSettings.Get("ScreenHeight", out screenHeight);
 
        DesertPaintLab.AppSettings.Get("PixelMultiplier", out pixelMultiplier);
 
        DesertPaintLab.AppSettings.Get("InterfaceSize", out interfaceSizeIndex);
 

	
 
        captureView.ScreenBuffer = screenBuffer;
 
    }
 
}
PlayerProfile.cs
Show inline comments
...
 
@@ -518,3 +518,3 @@ namespace DesertPaintLab
 
                writer.WriteLine("{| class='wikitable sortable' border=\"1\" style=\"background-color:#DEB887;\"");
 
                writer.WriteLine("! Color !! Recipe !! Verified");    
 
                writer.WriteLine("! Color !! Recipe !! Missing Reactions? || Verified");
 
                foreach (PaintColor color in Palette.Colors)
...
 
@@ -549,3 +549,3 @@ namespace DesertPaintLab
 
                    
 
                    if (recipe.CheckMissingReactions(ref missing) == false)
 
                    if (recipe.CheckMissingReactions(ref missing) == true)
 
                    {
...
 
@@ -553,2 +553,8 @@ namespace DesertPaintLab
 
                    }
 
                    else
 
                    {
 
                        colorLine += "N";
 
                    }
 

	
 
                    colorLine += " || N";
 
                    writer.WriteLine(colorLine);
ReactionRecorder.cs
Show inline comments
...
 
@@ -30,21 +30,94 @@ namespace DesertPaintLab
 
    {
 
        public delegate void CaptureProgressHandler(int x, int y);
 
        public CaptureProgressHandler OnCaptureProgress;
 

	
 
        const int COLOR_TOLERANCE = 3;
 

	
 
        const int DEFAULT_SWATCH_HEIGHT = 24; // including top and bottom borders
 
        const int DEFAULT_SWATCH_WIDTH = 260;
 
        const int DEFAULT_COLOR_BAR_WIDTH = 306;
 
        const int DEFAULT_RED_BAR_SPACING = 32;
 
        const int DEFAULT_GREEN_BAR_SPACING = 42;
 
        const int DEFAULT_BLUE_BAR_SPACING = 52;
 

	
 
        const int DEFAULT_SWATCH_TEST_WIDTH = 26; // width to test on ends of swatch (10% on either end)
 
        const InterfaceSize DEFAULT_INTERFACE_SIZE = InterfaceSize.Small;
 

	
 
        int swatchHeight = DEFAULT_SWATCH_HEIGHT;
 
        int swatchWidth = DEFAULT_SWATCH_WIDTH;
 
        int swatchTestWidth = DEFAULT_SWATCH_TEST_WIDTH;
 
        int colorBarWidth = DEFAULT_COLOR_BAR_WIDTH;
 
        int redBarSpacing = DEFAULT_RED_BAR_SPACING;
 
        int greenBarSpacing = DEFAULT_GREEN_BAR_SPACING;
 
        int blueBarSpacing = DEFAULT_BLUE_BAR_SPACING;
 
        public static readonly int[] SWATCH_HEIGHT = 
 
        {
 
            24, // tiny
 
            24, // small
 
            24, // medium
 
            24, // large
 
            24 // huge
 
        };
 
        public static readonly int[] SWATCH_WIDTH =
 
        {
 
            260, // tiny
 
            260, // small
 
            260, // medium
 
            274, // large
 
            304 // huge
 
        };
 
        public static readonly int[] COLOR_BAR_WIDTH =
 
        {
 
            306, // tiny
 
            306, // small
 
            306, // medium
 
            320, // large
 
            350 // huge
 
        };
 
        public static readonly int[] RED_BAR_SPACING =
 
        {
 
            32, // tiny
 
            32, // small
 
            32, // medium
 
            32, // large
 
            32 // huge
 
        };
 
        public static readonly int[] GREEN_BAR_SPACING =
 
        {
 
            42, // tiny
 
            42, // small
 
            42, // medium
 
            42, // large
 
            42 // huge
 
        };
 
        public static readonly int[] BLUE_BAR_SPACING =
 
        {
 
            52, // tiny
 
            52, // small
 
            52, // medium
 
            52, // large
 
            52 // huge
 
        };
 
        // width to test on ends of swatch (10% on either end)
 
        public static readonly int[] SWATCH_TEST_WIDTH =
 
        {
 
            26, // tiny
 
            26, // small
 
            26, // medium
 
            28, // large
 
            31  // huge
 
        };
 

	
 
        int swatchHeight = SWATCH_HEIGHT[(int)DEFAULT_INTERFACE_SIZE];
 
        int swatchWidth = SWATCH_WIDTH[(int)DEFAULT_INTERFACE_SIZE];
 
        int swatchTestWidth = SWATCH_TEST_WIDTH[(int)DEFAULT_INTERFACE_SIZE];
 
        int colorBarWidth = COLOR_BAR_WIDTH[(int)DEFAULT_INTERFACE_SIZE];
 
        int redBarSpacing = RED_BAR_SPACING[(int)DEFAULT_INTERFACE_SIZE];
 
        int greenBarSpacing = GREEN_BAR_SPACING[(int)DEFAULT_INTERFACE_SIZE];
 
        int blueBarSpacing = BLUE_BAR_SPACING[(int)DEFAULT_INTERFACE_SIZE];
 

	
 
        public int SwatchHeight {  get { return swatchHeight; } }
 
        public int SwatchWidth {  get { return swatchWidth; } }
 
        public int ColorBarWidth { get { return colorBarWidth;  } }
 
        public int RedBarSpacing {  get { return redBarSpacing; } }
 
        public int GreenBarSpacing { get { return greenBarSpacing; } }
 
        public int BlueBarSpacing {  get { return blueBarSpacing; } }
 

	
 
        // Current Status
 
        public bool IsCaptured { get; private set; }
 
        public int X { get; private set; }
 
        public int Y { get; private set; }
 
        public int ScreenWidth { get; private set; }
 
        public int ScreenHeight { get; private set; }
 
        public PaintColor RecordedColor { get; private set; }
 
        public int RedBarX { get; private set; }
 
        public int RedBarY { get; private set; }
 

	
 
        int pixelMultiplier = 1;
 
        InterfaceSize interfaceSize;
 

	
...
 
@@ -53,2 +126,4 @@ namespace DesertPaintLab
 
        int lastSwatchY = -1;
 
        public int SwatchX { get { return lastSwatchX; } }
 
        public int SwatchY { get { return lastSwatchY; } }
 

	
...
 
@@ -66,15 +141,8 @@ namespace DesertPaintLab
 

	
 
        private StreamWriter _log;
 
        public StreamWriter Log
 
        {
 
            set
 
            {
 
                _log = value;
 
            }
 
        }
 
        public StreamWriter Log { get; set; }
 
        private void WriteLog(string format, params object[] args)
 
        {
 
            if (_log != null)
 
            if (Log != null)
 
            {
 
                _log.WriteLine(format, args);
 
                Log.WriteLine(format, args);
 
            }
...
 
@@ -82,12 +150,16 @@ namespace DesertPaintLab
 

	
 
        public delegate void ReactionRecordedHandler(Reagent reagent1, Reagent reagent2, Reaction reaction);
 
        public ReactionRecordedHandler OnReactionRecorded;
 

	
 
        public ReactionRecorder()
 
        {
 
            this.pixelMultiplier = 1;
 
            swatchHeight = DEFAULT_SWATCH_HEIGHT * pixelMultiplier;
 
            swatchWidth = DEFAULT_SWATCH_WIDTH * pixelMultiplier;
 
            colorBarWidth = DEFAULT_COLOR_BAR_WIDTH * pixelMultiplier;
 
            redBarSpacing = DEFAULT_RED_BAR_SPACING * pixelMultiplier;
 
            greenBarSpacing = DEFAULT_GREEN_BAR_SPACING * pixelMultiplier;
 
            blueBarSpacing = DEFAULT_BLUE_BAR_SPACING * pixelMultiplier;
 
            swatchTestWidth = DEFAULT_SWATCH_TEST_WIDTH * pixelMultiplier;
 
            pixelMultiplier = 1;
 
            interfaceSize = DEFAULT_INTERFACE_SIZE;
 
            swatchHeight = SWATCH_HEIGHT[(int)interfaceSize] * pixelMultiplier;
 
            swatchWidth = SWATCH_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            colorBarWidth = COLOR_BAR_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            redBarSpacing = RED_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            greenBarSpacing = GREEN_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            blueBarSpacing = BLUE_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            swatchTestWidth = SWATCH_TEST_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
        }
...
 
@@ -97,9 +169,23 @@ namespace DesertPaintLab
 
            this.pixelMultiplier = pixelMultiplier;
 
            swatchHeight = DEFAULT_SWATCH_HEIGHT * pixelMultiplier;
 
            swatchWidth = DEFAULT_SWATCH_WIDTH * pixelMultiplier;
 
            colorBarWidth = DEFAULT_COLOR_BAR_WIDTH * pixelMultiplier;
 
            redBarSpacing = DEFAULT_RED_BAR_SPACING * pixelMultiplier;
 
            greenBarSpacing = DEFAULT_GREEN_BAR_SPACING * pixelMultiplier;
 
            blueBarSpacing = DEFAULT_BLUE_BAR_SPACING * pixelMultiplier;
 
            swatchTestWidth = DEFAULT_SWATCH_TEST_WIDTH * pixelMultiplier;
 
            this.interfaceSize = DEFAULT_INTERFACE_SIZE;
 
            swatchHeight = SWATCH_HEIGHT[(int)interfaceSize] * pixelMultiplier;
 
            swatchWidth = SWATCH_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            colorBarWidth = COLOR_BAR_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            redBarSpacing = RED_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            greenBarSpacing = GREEN_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            blueBarSpacing = BLUE_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            swatchTestWidth = SWATCH_TEST_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
        }
 

	
 
        public ReactionRecorder(int pixelMultiplier, InterfaceSize interfaceSize)
 
        {
 
            this.pixelMultiplier = pixelMultiplier;
 
            this.interfaceSize = interfaceSize;
 
            swatchHeight = SWATCH_HEIGHT[(int)interfaceSize] * pixelMultiplier;
 
            swatchWidth = SWATCH_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            colorBarWidth = COLOR_BAR_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            redBarSpacing = RED_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            greenBarSpacing = GREEN_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            blueBarSpacing = BLUE_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            swatchTestWidth = SWATCH_TEST_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
        }
...
 
@@ -117,10 +203,24 @@ namespace DesertPaintLab
 
        {
 
            swatchHeight    = DEFAULT_SWATCH_HEIGHT * pixelMultiplier;
 
            swatchWidth     = DEFAULT_SWATCH_WIDTH * pixelMultiplier;
 
            colorBarWidth   = DEFAULT_COLOR_BAR_WIDTH * pixelMultiplier;
 
            redBarSpacing   = DEFAULT_RED_BAR_SPACING * pixelMultiplier;
 
            greenBarSpacing = DEFAULT_GREEN_BAR_SPACING * pixelMultiplier;
 
            blueBarSpacing  = DEFAULT_BLUE_BAR_SPACING * pixelMultiplier;
 
            swatchTestWidth = DEFAULT_SWATCH_TEST_WIDTH * pixelMultiplier;
 
            this.pixelMultiplier = pixelMultiplier;
 

	
 
            swatchHeight = SWATCH_HEIGHT[(int)interfaceSize] * pixelMultiplier;
 
            swatchWidth      = SWATCH_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            colorBarWidth    = COLOR_BAR_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            redBarSpacing    = RED_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            greenBarSpacing  = GREEN_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            blueBarSpacing   = BLUE_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            swatchTestWidth  = SWATCH_TEST_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
        }
 

	
 
        public void SetInterfaceSize(InterfaceSize interfaceSize)
 
        {
 
            this.interfaceSize = interfaceSize;
 

	
 
            swatchHeight = SWATCH_HEIGHT[(int)interfaceSize] * pixelMultiplier;
 
            swatchWidth = SWATCH_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            colorBarWidth = COLOR_BAR_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
            redBarSpacing = RED_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            greenBarSpacing = GREEN_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            blueBarSpacing = BLUE_BAR_SPACING[(int)interfaceSize] * pixelMultiplier;
 
            swatchTestWidth = SWATCH_TEST_WIDTH[(int)interfaceSize] * pixelMultiplier;
 
        }
...
 
@@ -301,14 +401,15 @@ namespace DesertPaintLab
 
                    redPixelStart = pixelStart + (redBarSpacing * stride);
 
                    int redPixel = redPixelStart;
 
                    int redPixelCount = 0;
 
                    while ((pixBytes[redPixelStart] > 0x9F) &&
 
                           (pixBytes[redPixelStart + 1] < 0x62) &&
 
                           (pixBytes[redPixelStart + 2] < 0x62))
 
                    while ((pixBytes[redPixel] > 0x9F) &&
 
                           (pixBytes[redPixel + 1] < 0x62) &&
 
                           (pixBytes[redPixel + 2] < 0x62))
 
                    {
 
                        redPixelCount++;
 
                        // pixBytes[redPixelStart] = 0x00;
 
                        // pixBytes[redPixelStart + 1] = 0xFF;
 
                        // pixBytes[redPixelStart + 2] = 0xFF;
 
                        redPixelStart += 3;
 
                        // pixBytes[redPixel] = 0x00;
 
                        // pixBytes[redPixel + 1] = 0xFF;
 
                        // pixBytes[redPixel + 2] = 0xFF;
 
                        redPixel += 3;
 
                    }
 
                    WriteLog("Color {0}, {1}, {2} is no longer red at {3},{4}", pixBytes[redPixelStart], pixBytes[redPixelStart + 1], pixBytes[redPixelStart + 2], (redPixelStart % stride)/3, redPixelStart / stride);
 
                    WriteLog("Color {0}, {1}, {2} is no longer red at {3},{4}", pixBytes[redPixel], pixBytes[redPixel + 1], pixBytes[redPixel + 2], (redPixel % stride)/3, redPixel / stride);
 

	
...
 
@@ -328,3 +429,3 @@ namespace DesertPaintLab
 
                    }
 
                    WriteLog("Color {0}, {1}, {2} is no longer green at pixel offset {3},{4}", pixBytes[greenPixelStart], pixBytes[greenPixelStart + 1], pixBytes[greenPixelStart + 2], (greenPixelStart % stride)/3, redPixelStart / stride);
 
                    WriteLog("Color {0}, {1}, {2} is no longer green at pixel offset {3},{4}", pixBytes[greenPixelStart], pixBytes[greenPixelStart + 1], pixBytes[greenPixelStart + 2], (greenPixelStart % stride)/3, greenPixelStart / stride);
 

	
...
 
@@ -354,4 +455,10 @@ namespace DesertPaintLab
 

	
 
        unsafe public bool CaptureReaction(byte* pixBytes, int screenshotWidth, int screenshotHeight, int stride, ref PaintColor reactedColor, ref int redPixelStart)
 
        unsafe public bool CaptureReaction(byte* pixBytes, int screenshotWidth, int screenshotHeight, int stride)
 
        {
 
            PaintColor reactedColor = new PaintColor();
 
            int redPixelStart = 0;
 
            ScreenWidth = screenshotWidth;
 
            ScreenHeight = screenshotHeight;
 

	
 
            IsCaptured = false;
 
            if (!firstRun)
...
 
@@ -361,2 +468,6 @@ namespace DesertPaintLab
 
                {
 
                    IsCaptured = true;
 
                    RedBarX = (redPixelStart % stride) / 3;
 
                    RedBarY = redPixelStart / stride;
 
                    RecordedColor = reactedColor;
 
                    return true;
...
 
@@ -369,13 +480,18 @@ namespace DesertPaintLab
 

	
 
            for (int x = 0; x < screenshotWidth - colorBarWidth; ++x)
 
            for (X = 0; X < screenshotWidth - colorBarWidth; ++X)
 
            {
 
                for (int y = 0; y < (screenshotHeight - (blueBarSpacing + 1)  /*53*/); ++y)
 
                for (int Y = 0; Y < (screenshotHeight - (blueBarSpacing + 10)  /*53*/); ++Y)
 
                {
 
                    if (TestPosition(X, Y, pixBytes, screenshotWidth, screenshotHeight, stride, ref reactedColor, ref redPixelStart))
 
                {
 
                    if (TestPosition(x, y, pixBytes, screenshotWidth, screenshotHeight, stride, ref reactedColor, ref redPixelStart))
 
                    {
 
                        lastSwatchX = x;
 
                        lastSwatchY = y;
 
                        RedBarX = (redPixelStart % stride) / 3;
 
                        RedBarY = redPixelStart / stride;
 
                        RecordedColor = reactedColor;
 
                        lastSwatchX = X;
 
                        lastSwatchY = Y;
 
                        firstRun = false;
 
                        IsCaptured = true;
 
                        return true;
 
                    }
 
                    OnCaptureProgress?.Invoke(X, Y);
 
                }
...
 
@@ -405,5 +521,7 @@ namespace DesertPaintLab
 
                    b = b - reaction1.Blue - reaction3.Blue;
 
                    profile.SetReaction(reagents[0], reagents[2], new Reaction(r, g, b));
 
                    Reaction reaction = new Reaction(r, g, b);
 
                    profile.SetReaction(reagents[0], reagents[2], reaction);
 
                    profile.Save();
 
                    saved = true;
 
                    OnReactionRecorded?.Invoke(reagents[0], reagents[2], reaction);
 
                }
...
 
@@ -414,5 +532,7 @@ namespace DesertPaintLab
 
                    b = b - reaction1.Blue - reaction2.Blue;
 
                    profile.SetReaction(reagents[1], reagents[2], new Reaction(r, g, b));
 
                    Reaction reaction = new Reaction(r, g, b);
 
                    profile.SetReaction(reagents[1], reagents[2], reaction);
 
                    profile.Save();
 
                    saved = true;
 
                    OnReactionRecorded?.Invoke(reagents[1], reagents[2], reaction);
 
                }   
...
 
@@ -425,5 +545,7 @@ namespace DesertPaintLab
 
                b = reactedColor.Blue - expectedColor.Blue;
 
                profile.SetReaction(reagents[0], reagents[1], new Reaction(r, g, b));
 
                Reaction reaction = new Reaction(r, g, b);
 
                profile.SetReaction(reagents[0], reagents[1], reaction);
 
                profile.Save();
 
                saved = true;
 
                OnReactionRecorded?.Invoke(reagents[0], reagents[1], reaction);
 
            }
ReactionStatusWindow.cs
Show inline comments
...
 
@@ -6,3 +6,5 @@ namespace DesertPaintLab
 
    {
 
        //PlayerProfile profile;
 
        PlayerProfile _profile;
 

	
 
        Gtk.ListStore reagentListStore;
 

	
...
 
@@ -10,3 +12,3 @@ namespace DesertPaintLab
 
        {
 
            //this.profile = profile;
 
            _profile = profile;
 
            this.Build();
...
 
@@ -15,2 +17,4 @@ namespace DesertPaintLab
 

	
 
            SetupReagentList();
 

	
 
            int count = 0;
...
 
@@ -51,2 +55,37 @@ namespace DesertPaintLab
 
        }
 

	
 
        public void RefreshReactions()
 
        {
 
            while (resultbox.Children.Length > 0)
 
            {
 
                Gtk.Widget child = resultbox.Children[0];
 
                resultbox.Remove(child);
 
            }
 
            int count = 0;
 
            foreach (string name1 in ReagentManager.Names)
 
            {
 
                Reagent reagent1 = ReagentManager.GetReagent(name1);
 
                foreach (string name2 in ReagentManager.Names)
 
                {
 
                    if (name1.Equals(name2))
 
                    {
 
                        continue;
 
                    }
 
                    Reagent reagent2 = ReagentManager.GetReagent(name2);
 
                    if (!reagent1.Enabled || !reagent2.Enabled) continue;
 
                    Reaction reaction = _profile.FindReaction(reagent1, reagent2);
 
                    if (reaction == null)
 
                    {
 
                        if (count == 0)
 
                        {
 
                            Gtk.Label header = new Gtk.Label("Missing Reactions:");
 
                            resultbox.PackStart(header, false, false, 0);
 
                            Gtk.HSeparator sep = new Gtk.HSeparator();
 
                            resultbox.PackStart(sep, false, false, 0);
 
                        }
 
                        Gtk.Label label = new Gtk.Label(name1 + " + " + name2);
 
                        resultbox.PackStart(label, false, false, 0);
 

	
 
                        ++count;
 
                    }
 
    }
...
 
@@ -54,1 +93,79 @@ namespace DesertPaintLab
 

	
 
            if (count == 0)
 
            {
 
                Gtk.Label header = new Gtk.Label("All reactions recorded!");
 
                resultbox.PackStart(header, false, false, 0);
 
            }
 
            ShowAll();
 
        }
 

	
 
        private void OnReagentToggled(object o, Gtk.ToggledArgs args)
 
        {
 
            Gtk.TreeIter iter;
 
            reagentListStore.GetIter(out iter, new Gtk.TreePath(args.Path));
 

	
 
            Reagent reagent = (Reagent)reagentListStore.GetValue(iter, 0);
 
            reagent.Enabled = !reagent.Enabled;
 
            // TODO: SaveReagentSettings();
 
            RefreshReactions();
 
        }
 

	
 
        // Reagent view handling
 
        private void RenderReagentToggle(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
 
        {
 
            Reagent reagent = (Reagent)model.GetValue(iter, 0);
 
            Gtk.CellRendererToggle toggle = (cell as Gtk.CellRendererToggle);
 
            toggle.Active = reagent.Enabled;
 
            toggle.Activatable = !reagent.IsCatalyst;
 
            toggle.Mode = reagent.IsCatalyst ? Gtk.CellRendererMode.Inert : Gtk.CellRendererMode.Activatable;
 
        }
 

	
 
        void SetupReagentList()
 
        {
 
            // initialize reagent list
 
            reagentListStore = new Gtk.ListStore(typeof(Reagent), typeof(string), typeof(Reagent), typeof(Reagent));
 
            foreach (string reagentName in ReagentManager.Names)
 
            {
 
                Reagent reagent = ReagentManager.GetReagent(reagentName);
 
                reagentListStore.AppendValues(reagent, reagentName); // , reagent, reagent);
 
            }
 

	
 
            // Add the columns to the TreeView
 
            Gtk.TreeViewColumn reagentEnabledColumn = new Gtk.TreeViewColumn();
 
            reagentEnabledColumn.Title = "Enabled";
 
            Gtk.CellRendererToggle reagentEnabledCell = new Gtk.CellRendererToggle();
 
            reagentEnabledCell.Activatable = true;
 
            reagentEnabledCell.Sensitive = true;
 
            reagentEnabledCell.Mode = Gtk.CellRendererMode.Activatable;
 
            reagentEnabledCell.Visible = true;
 
            reagentEnabledCell.Toggled += new Gtk.ToggledHandler(OnReagentToggled);
 
            reagentEnabledColumn.PackStart(reagentEnabledCell, true);
 
            //reagentEnabledColumn.AddAttribute(reagentEnabledCell, "active", 0);
 

	
 
            Gtk.TreeViewColumn reagentNameColumn = new Gtk.TreeViewColumn();
 
            reagentNameColumn.Title = "Ingredient";
 
            Gtk.CellRendererText reagentNameCell = new Gtk.CellRendererText();
 
            reagentNameCell.Mode = Gtk.CellRendererMode.Inert;
 
            reagentNameColumn.PackStart(reagentNameCell, true);
 
            reagentNameColumn.AddAttribute(reagentNameCell, "text", 1);
 
            reagentNameColumn.Expand = true;
 

	
 
            reagentListStore = new Gtk.ListStore(typeof(Reagent), typeof(string), typeof(Reagent), typeof(Reagent));
 
            foreach (string reagentName in ReagentManager.Names)
 
            {
 
                Reagent reagent = ReagentManager.GetReagent(reagentName);
 
                reagentListStore.AppendValues(reagent, reagentName); // , reagent, reagent);
 
            }
 

	
 
            reagentEnabledColumn.SetCellDataFunc(reagentEnabledCell, new Gtk.TreeCellDataFunc(RenderReagentToggle));
 

	
 
            // Assign the model to the TreeView
 
            reagentListView.Model = reagentListStore;
 
            reagentListView.Sensitive = true;
 

	
 
            reagentListView.AppendColumn(reagentEnabledColumn);
 
            reagentListView.AppendColumn(reagentNameColumn);
 
        }
 
    }
 
}
 

	
ScreenCheckDialog.cs
Show inline comments
...
 
@@ -52,2 +52,30 @@ namespace DesertPaintLab
 

	
 
        private int _detectedScreenWidth;
 
        private int _detectedScreenHeight;
 
        public int DetectedScreenWidth
 
        {
 
            get
 
            {
 
                return _detectedScreenWidth;
 
            }
 
            set
 
            {
 
                _detectedScreenWidth = value;
 
                detectedResolutionLabel.Text = string.Format("Detected: {0} x {1}", _detectedScreenWidth, _detectedScreenHeight);
 
            }
 
        }
 

	
 
        public int DetectedScreenHeight
 
        {
 
            get
 
            {
 
                return _detectedScreenHeight;
 
            }
 
            set
 
            {
 
                _detectedScreenHeight = value;
 
                detectedResolutionLabel.Text = string.Format("Detected: {0} x {1}", _detectedScreenWidth, _detectedScreenHeight);
 
            }
 
        }
 

	
 
		public int GamePixelWidth
...
 
@@ -64,2 +92,17 @@ namespace DesertPaintLab
 

	
 
        public InterfaceSize InterfaceSize
 
        {
 
            get
 
            {
 
                InterfaceSize result = (InterfaceSize)interfaceSizeComboBox.Active;
 
                return result;
 
            }
 
            set
 
            {
 
                Gtk.TreeIter iter;
 
                interfaceSizeComboBox.Model.IterNthChild(out iter, (int)value);
 
                interfaceSizeComboBox.SetActiveIter(iter);
 
            }
 
        }
 

	
 
		public ScreenCheckDialog ()
UI/CaptureView.cs
Show inline comments
...
 
@@ -2,2 +2,3 @@
 
using System.IO;
 
using System.Threading;
 

	
...
 
@@ -19,2 +20,5 @@ namespace DesertPaintLab
 

	
 
        Gtk.ThreadNotify notifyCaptureProgress;
 
        Gtk.ThreadNotify notifyCaptureComplete;
 

	
 
        bool recordEnabled = true;
...
 
@@ -46,2 +50,14 @@ namespace DesertPaintLab
 

	
 
        public Gdk.Pixbuf ScreenBuffer
 
        {
 
            get { return screenBuffer; }
 
            set {
 
                if (screenBuffer != null)
 
                {
 
                    // TODO: free it up?
 
                }
 
                screenBuffer = value;
 
            }
 
        }
 

	
 
        public PlayerProfile Profile
...
 
@@ -246,22 +262,15 @@ namespace DesertPaintLab
 

	
 
        unsafe bool CaptureReactionColor()
 
        unsafe void BeginCapture()
 
        {
 
            // Take a screenshot.
 
            int screenWidth, screenHeight;
 
            bool debugScreenshot = false;
 
            captureButton.Sensitive = false;
 
            ingredient1ComboBox.Sensitive = false;
 
            ingredient2ComboBox.Sensitive = false;
 
            ingredient3ComboBox.Sensitive = false;
 
            clearReactionButton.Sensitive = false;
 

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

	
 
            bool enableDebugMenu = false;
 
            Gdk.Window rootWindow = Gdk.Global.DefaultRootWindow;
 
            DesertPaintLab.AppSettings.Get("ScreenWidth", out screenWidth);
 
            DesertPaintLab.AppSettings.Get("ScreenHeight", out screenHeight);
 
            DesertPaintLab.AppSettings.Get("EnableDebugMenu", out enableDebugMenu);
 
            DesertPaintLab.AppSettings.Get("DebugScreenshot", out debugScreenshot);
 
            Gdk.Image rootImage = rootWindow.GetImage(0, 0, screenWidth, screenHeight);
 
            screenBuffer.GetFromImage(rootImage, rootImage.Colormap, 0, 0, 0, 0, screenWidth, screenHeight);
 
            rootImage.Unref();
 
            System.GC.Collect(); // really, clean up now
 
            //screenBuffer.GetFromDrawable(rootWindow,
 
            //  rootWindow.Colormap, 0, 0, 0, 0, screenWidth, screenHeight);
 
            int stride = screenBuffer.Rowstride;
 
            byte* pixBytes = (byte*)screenBuffer.Pixels;
 
            int redPixelStart = -1;
 

	
...
 
@@ -274,3 +283,48 @@ namespace DesertPaintLab
 
            }
 
            isCaptured = ReactionRecorder.Instance.CaptureReaction(pixBytes, screenWidth, screenHeight, stride, ref reactedColor, ref redPixelStart);
 

	
 
            if (notifyCaptureProgress == null)
 
            {
 
                notifyCaptureProgress = new Gtk.ThreadNotify(new Gtk.ReadyEvent(NotifyCaptureProgress));
 
                notifyCaptureComplete = new Gtk.ThreadNotify(new Gtk.ReadyEvent(NotifyCaptureComplete));
 
            }
 

	
 
            this.reactionSwatch.Color = new PaintColor("Searching", "00", "00", "00");
 

	
 
            Thread thr = new Thread(new ThreadStart(this.CaptureReactionThread));
 
            thr.Priority = ThreadPriority.AboveNormal;
 
            thr.Start();
 
            //OnCaptureComplete(isCaptured, reactedColor, screenWidth, screenHeight, stride, redPixelStart);
 
        }
 

	
 
        unsafe private void CaptureReactionThread()
 
        {
 
            byte* pixBytes = (byte*)screenBuffer.Pixels;
 

	
 
            ReactionRecorder.Instance.OnCaptureProgress += OnCaptureProgress;
 
            ReactionRecorder.Instance.CaptureReaction(pixBytes, screenBuffer.Width, screenBuffer.Height, screenBuffer.Rowstride);
 
            ReactionRecorder.Instance.OnCaptureProgress -= OnCaptureProgress;
 

	
 
            notifyCaptureComplete.WakeupMain();
 
        }
 

	
 
        private void OnCaptureProgress(int x, int y)
 
        {
 
            notifyCaptureProgress.WakeupMain();
 
        }
 

	
 
        private void NotifyCaptureProgress()
 
        {
 
            // TODO: progress bar
 
            //ReactionRecorder.Instance.X;
 
            //ReactionRecorder.Instance.Y;
 
            progressBar.Fraction = ((double)(ReactionRecorder.Instance.X) / (double)(ReactionRecorder.Instance.ScreenWidth - ReactionRecorder.Instance.ColorBarWidth));
 
        }
 

	
 
        void OnCaptureComplete(bool isCaptured, PaintColor reactedColor, int swatchX, int swatchY)
 
        {
 
            int screenWidth = screenBuffer.Width;
 
            int screenHeight = screenBuffer.Height;
 
            int stride = screenBuffer.Rowstride;
 

	
 
            StreamWriter log = ReactionRecorder.Instance.Log;
 
            if (log != null)
...
 
@@ -280,3 +334,9 @@ namespace DesertPaintLab
 
                log = null;
 
                ReactionRecorder.Instance.Log = null;
 
            }
 

	
 
            bool enableDebugMenu = false;
 
            DesertPaintLab.AppSettings.Get("EnableDebugMenu", out enableDebugMenu);
 
            bool debugScreenshot = false;
 
            DesertPaintLab.AppSettings.Get("DebugScreenshot", out debugScreenshot);
 
            if (enableDebugMenu && debugScreenshot)
...
 
@@ -293,5 +353,2 @@ namespace DesertPaintLab
 
                    // record the swatch that was captured
 
                    // convert to pixel offset instead of byte
 
                    int redPixelStartX = (redPixelStart % stride) / 3;
 
                    int redPixelStartY = (redPixelStart / stride);
 
                    // write out the screenshot
...
 
@@ -299,5 +356,13 @@ namespace DesertPaintLab
 
                    string filename = FileUtils.FindNumberedFile("DesertPaintLab_Colormatch", "png", screenshotDir);
 
                    int captureAreaWidth = Math.Min(64, screenWidth - redPixelStartX + 64);
 
                    int captureAreaHeight = Math.Min(64, screenHeight - redPixelStartY + 64);
 
                    Gdk.Pixbuf outPixBuf = new Gdk.Pixbuf(screenBuffer, Math.Max(0, redPixelStartX - 32), Math.Max(0, redPixelStartY - 32), captureAreaWidth, captureAreaHeight);
 
                    int x = swatchX - 16;
 
                    int captureAreaWidth = ReactionRecorder.Instance.ColorBarWidth + 32;
 
                    captureAreaWidth = Math.Min(screenWidth - x, captureAreaWidth);
 
                    int y = swatchY - 16;
 
                    int captureAreaHeight = ReactionRecorder.Instance.BlueBarSpacing + 42;
 
                    captureAreaHeight = Math.Min(screenHeight - y, captureAreaHeight);
 

	
 
                    Gdk.Pixbuf outPixBuf = new Gdk.Pixbuf(screenBuffer, Math.Max(0, x), Math.Max(0, y), 
 
                        captureAreaWidth, captureAreaHeight);
 
                    //Gdk.Pixbuf outPixBuf = new Gdk.Pixbuf(screenBuffer, Math.Max(0, redPixelStartX), Math.Max(0, redPixelStartY),
 
                    //    ReactionRecorder.Instance.ColorBarWidth, ReactionRecorder.Instance.GreenBarSpacing - ReactionRecorder.Instance.RedBarSpacing);
 
                    //screenBuffer.Save(filename, "png");
...
 
@@ -308,8 +373,3 @@ namespace DesertPaintLab
 
            
 
            return isCaptured;
 
        }
 

	
 
        protected virtual void OnCapture(object sender, System.EventArgs e)
 
        {
 
            if (CaptureReactionColor())
 
            if (isCaptured)
 
            {
...
 
@@ -359,2 +419,4 @@ namespace DesertPaintLab
 
                }
 

	
 
                captureButton.Sensitive = false;
 
            }
...
 
@@ -373,2 +435,39 @@ namespace DesertPaintLab
 
            }
 

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

	
 
            ingredient1ComboBox.Sensitive = true;
 
            ingredient2ComboBox.Sensitive = true;
 
            ingredient3ComboBox.Sensitive = false;
 
            UpdateIngredients();
 
        }
 

	
 
        private void NotifyCaptureComplete()
 
        {
 
            OnCaptureComplete(
 
                ReactionRecorder.Instance.IsCaptured,
 
                ReactionRecorder.Instance.RecordedColor,
 
                ReactionRecorder.Instance.SwatchX,
 
                ReactionRecorder.Instance.SwatchY);
 
        }
 

	
 
        unsafe void CaptureReactionColor()
 
        {
 
            // Take a screenshot.
 
            int screenWidth, screenHeight;
 
            Gdk.Window rootWindow = Gdk.Global.DefaultRootWindow;
 
            DesertPaintLab.AppSettings.Get("ScreenWidth", out screenWidth);
 
            DesertPaintLab.AppSettings.Get("ScreenHeight", out screenHeight);
 
            Gdk.Image rootImage = rootWindow.GetImage(0, 0, screenWidth, screenHeight);
 
            screenBuffer.GetFromImage(rootImage, rootImage.Colormap, 0, 0, 0, 0, screenWidth, screenHeight);
 
            rootImage.Unref();
 
            System.GC.Collect(); // really, clean up now
 

	
 
            BeginCapture();
 
        }
 

	
 
        protected virtual void OnCapture(object sender, System.EventArgs e)
 
        {
 
            CaptureReactionColor();
 
        }
...
 
@@ -396,3 +495,2 @@ namespace DesertPaintLab
 
            UpdateIngredients();
 
    
 
        }
gtk-gui/DesertPaintLab.CaptureView.cs
Show inline comments
...
 
@@ -60,2 +60,4 @@ namespace DesertPaintLab
 

	
 
        private global::Gtk.ProgressBar progressBar;
 

	
 
		protected virtual void Build ()
...
 
@@ -253,2 +255,12 @@ namespace DesertPaintLab
 
			w19.Position = 0;
 

	
 
            this.progressBar = new global::Gtk.ProgressBar();
 
            this.progressBar.Name = "progressBar";
 
            this.vbox4.Add(this.progressBar);
 
            global::Gtk.Box.BoxChild wProgress = ((global::Gtk.Box.BoxChild)(this.vbox4[this.progressBar]));
 
            wProgress.PackType = ((global::Gtk.PackType)(1));
 
            wProgress.Position = 1;
 
            wProgress.Expand = false;
 
            wProgress.Fill = false;
 

	
 
			// Container child vbox4.Gtk.Box+BoxChild
...
 
@@ -261,3 +273,3 @@ namespace DesertPaintLab
 
			global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.recordButton]));
 
			w20.Position = 1;
 
			w20.Position = 2;
 
			w20.Expand = false;
...
 
@@ -274,3 +286,3 @@ namespace DesertPaintLab
 
			global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.reactedColorFrame]));
 
			w23.Position = 2;
 
			w23.Position = 3;
 
			w23.Expand = false;
...
 
@@ -282,2 +294,3 @@ namespace DesertPaintLab
 
			this.clearReactionButton.Hide ();
 
            this.progressBar.Hide();
 
			this.Hide ();
gtk-gui/DesertPaintLab.ReactionStatusWindow.cs
Show inline comments
...
 
@@ -6,2 +6,14 @@ namespace DesertPaintLab
 
	{
 
        private global::Gtk.HBox hbox1;
 

	
 
        private global::Gtk.Frame ingredientFrame;
 
        private global::Gtk.Alignment ingredientAlignment;
 

	
 
        private global::Gtk.ScrolledWindow scrolledwindow2;
 

	
 
        private global::Gtk.TreeView reagentListView;
 

	
 
        private global::Gtk.Label GtkLabel4;
 

	
 

	
 
		private global::Gtk.ScrolledWindow scroller;
...
 
@@ -17,4 +29,44 @@ namespace DesertPaintLab
 
			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
 

	
 
            this.hbox1 = new global::Gtk.HBox();
 
            this.hbox1.Name = "hbox1";
 
            this.hbox1.Spacing = 6;
 

	
 
            // Reagent list
 
            // Container child vbox8.Gtk.Box+BoxChild
 
            this.ingredientFrame = new global::Gtk.Frame();
 
            this.ingredientFrame.Name = "frame3";
 
            this.ingredientFrame.ShadowType = ((global::Gtk.ShadowType)(0));
 
            // Container child ingredientFrame.Gtk.Container+ContainerChild
 
            this.ingredientAlignment = new global::Gtk.Alignment(0F, 0F, 1F, 1F);
 
            this.ingredientAlignment.Name = "GtkAlignment1";
 
            this.ingredientAlignment.LeftPadding = ((uint)(12));
 
            // Container child GtkAlignment1.Gtk.Container+ContainerChild
 
            this.scrolledwindow2 = new global::Gtk.ScrolledWindow();
 
            this.scrolledwindow2.CanFocus = true;
 
            this.scrolledwindow2.Name = "scrolledwindow2";
 
            this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
 
            // Container child scrolledwindow2.Gtk.Container+ContainerChild
 
            this.reagentListView = new global::Gtk.TreeView();
 
            this.reagentListView.WidthRequest = 240;
 
            this.reagentListView.CanFocus = true;
 
            this.reagentListView.Name = "reagentListView";
 
            this.scrolledwindow2.Add(this.reagentListView);
 
            this.ingredientAlignment.Add(this.scrolledwindow2);
 
            this.ingredientFrame.Add(this.ingredientAlignment);
 
            this.GtkLabel4 = new global::Gtk.Label();
 
            this.GtkLabel4.Name = "GtkLabel4";
 
            this.GtkLabel4.LabelProp = "<b>Ingredients</b>";
 
            this.GtkLabel4.UseMarkup = true;
 
            this.ingredientFrame.LabelWidget = this.GtkLabel4;
 
            this.hbox1.Add(this.ingredientFrame);
 
            global::Gtk.Box.BoxChild w0 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.ingredientFrame]));
 
            w0.Expand = false;
 
            w0.Fill = true;
 
            w0.Position = 0;
 

	
 

	
 
			// Container child DesertPaintLab.ReactionStatusWindow.Gtk.Container+ContainerChild
 
			this.scroller = new global::Gtk.ScrolledWindow ();
 
            this.scroller.WidthRequest = 300;
 
			this.scroller.CanFocus = true;
...
 
@@ -31,3 +83,10 @@ namespace DesertPaintLab
 
			this.scroller.Add (w1);
 
			this.Add (this.scroller);
 
            this.hbox1.Add(this.scroller);
 
            global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.scroller]));
 
            w2.Expand = true;
 
            w2.Fill = true;
 
            w2.Position = 1;
 

	
 
            this.Add(this.hbox1);
 

	
 
			if ((this.Child != null)) {
gtk-gui/DesertPaintLab.RecipeGeneratorView.cs
Show inline comments
...
 
@@ -192,3 +192,3 @@ namespace DesertPaintLab
 
			this.checkButtonRibbon.Name = "checkButtonRibbon";
 
			this.checkButtonRibbon.Label = "Ribbon Recipes";
 
			this.checkButtonRibbon.Label = "Silk Ribbon Recipes";
 
			this.checkButtonRibbon.DrawIndicator = true;
gtk-gui/DesertPaintLab.ScreenCheckDialog.cs
Show inline comments
...
 
@@ -12,2 +12,4 @@ namespace DesertPaintLab
 
		
 
        private global::Gtk.Label detectedResolutionLabel;
 

	
 
		private global::Gtk.Entry screenWidthEntry;
...
 
@@ -22,2 +24,8 @@ namespace DesertPaintLab
 
		
 
        private global::Gtk.HBox hbox3;
 

	
 
        private global::Gtk.Label interfaceSizeLlabel;
 

	
 
        private global::Gtk.ComboBox interfaceSizeComboBox;
 

	
 
		private global::Gtk.Button buttonOk;
...
 
@@ -41,2 +49,3 @@ namespace DesertPaintLab
 
			this.vbox2.BorderWidth = ((uint)(20));
 

	
 
			// Container child vbox2.Gtk.Box+BoxChild
...
 
@@ -80,2 +89,13 @@ namespace DesertPaintLab
 
			w5.Fill = false;
 

	
 
            // Container child vbox2.Gtk.Box+BoxChild
 
            this.detectedResolutionLabel = new global::Gtk.Label();
 
            this.detectedResolutionLabel.Name = "detectedResolutionLabel";
 
            this.detectedResolutionLabel.LabelProp = "Detected Screen Resolution: ??";
 
            this.vbox2.Add(this.detectedResolutionLabel);
 
            global::Gtk.Box.BoxChild wDR = ((global::Gtk.Box.BoxChild)(this.vbox2[this.detectedResolutionLabel]));
 
            wDR.Position =  1;
 
            wDR.Expand = false;
 
            wDR.Fill = false;
 

	
 
			// Container child vbox2.Gtk.Box+BoxChild
...
 
@@ -108,8 +128,52 @@ namespace DesertPaintLab
 
			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox2]));
 
			w8.Position = 1;
 
			w8.Position = 2;
 
			w8.Expand = false;
 
			w8.Fill = false;
 

	
 
            // Container child vbox2.Gtk.Box+BoxChild
 
            this.hbox3 = new global::Gtk.HBox();
 
            this.hbox3.Name = "hbox3";
 
            this.hbox3.Spacing = 20;
 
            this.hbox3.BorderWidth = ((uint)(10));
 
            // Container child hbox3.Gtk.Box+BoxChild
 
            this.interfaceSizeLlabel = new global::Gtk.Label();
 
            this.interfaceSizeLlabel.Name = "interfaceSizeLabel";
 
            this.interfaceSizeLlabel.LabelProp = "Interface Size";
 
            this.hbox3.Add(this.interfaceSizeLlabel);
 
            global::Gtk.Box.BoxChild interfaceSizeContainer = ((global::Gtk.Box.BoxChild)(this.hbox3[this.interfaceSizeLlabel]));
 
            interfaceSizeContainer.Position = 0;
 
            interfaceSizeContainer.Expand = false;
 
            interfaceSizeContainer.Fill = false;
 
            // Container child hbox2.Gtk.Box+BoxChild
 
            this.interfaceSizeComboBox = global::Gtk.ComboBox.NewText();
 
            this.interfaceSizeComboBox.Name = "interfaceSizeComboBox";
 
            this.hbox3.Add(this.interfaceSizeComboBox);
 
            global::Gtk.Box.BoxChild wInterfaceSize = ((global::Gtk.Box.BoxChild)(this.hbox2[this.interfaceSizeComboBox]));
 
            wInterfaceSize.Position = 1;
 
            this.vbox2.Add(this.hbox3);
 
            global::Gtk.Box.BoxChild wInterfaceSizeBox = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox3]));
 
            wInterfaceSizeBox.Position = 0;
 
            wInterfaceSizeBox.Expand = false;
 
            wInterfaceSizeBox.Fill = false;
 

	
 
            // Fill interface size box
 
            interfaceSizeComboBox.Clear();
 

	
 
            Gtk.CellRendererText cell = new Gtk.CellRendererText();
 
            interfaceSizeComboBox.PackStart(cell, false);
 
            interfaceSizeComboBox.AddAttribute(cell, "text", 0);
 
            Gtk.ListStore store = new Gtk.ListStore(typeof(string));
 
            interfaceSizeComboBox.Model = store;
 
            store.AppendValues("Tiny");
 
            store.AppendValues("Small");
 
            store.AppendValues("Medium");
 
            store.AppendValues("Large");
 
            store.AppendValues("Huge");
 
            Gtk.TreeIter iter;
 
            interfaceSizeComboBox.Model.IterNthChild(out iter, 1);
 
            interfaceSizeComboBox.SetActiveIter(iter);
 

	
 
			w1.Add (this.vbox2);
 
			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2]));
 
			w9.Position = 0;
 
			w9.Position = 3;
 
			// Internal child DesertPaintLab.ScreenCheckDialog.ActionArea
...
 
@@ -132,2 +196,3 @@ namespace DesertPaintLab
 
			w11.Fill = false;
 

	
 
			if ((this.Child != null)) {
gtk-gui/MainWindow.cs
Show inline comments
...
 
@@ -47,2 +47,4 @@ public partial class MainWindow
 
	
 
    private global::Gtk.Action PreferencesAction;
 

	
 
	private global::Gtk.VBox vbox1;
...
 
@@ -124,2 +126,5 @@ public partial class MainWindow
 
		w1.Add (this.ExportForPracticalPaintAction, null);
 
        this.PreferencesAction = new global::Gtk.Action("PreferencesAction", "Preferences", null, null);
 
        this.PreferencesAction.ShortLabel = "Preferences";
 
        w1.Add(this.PreferencesAction, null);
 
		this.UIManager.InsertActionGroup (w1, 0);
...
 
@@ -133,3 +138,3 @@ public partial class MainWindow
 
		// Container child vbox1.Gtk.Box+BoxChild
 
		this.UIManager.AddUiFromString ("<ui><menubar name='menu'><menu name='FileAction' action='FileAction'><menu name='ProfileAction' action='ProfileAction'><menuitem name='NewProfileAction' action='NewProfileAction'/><menuitem name='OpenProfileAction' action='OpenProfileAction'/><menuitem name='ImportProfileAction' action='ImportProfileAction'/><menuitem name='ExportProfileAction' action='ExportProfileAction'/><menuitem name='ExportForPracticalPaintAction' action='ExportForPracticalPaintAction'/></menu><menu name='RecipesAction' action='RecipesAction'><menuitem name='ExportRecipesAction' action='ExportRecipesAction'/><menuitem name='CopyRecipesToClipboardAction' action='CopyRecipesToClipboardAction'/></menu><separator/><menuitem name='ExitAction' action='ExitAction'/></menu><menu name='ViewAction' action='ViewAction'><menuitem name='CaptureAction' action='CaptureAction'/><menuitem name='SimulatorAction' action='SimulatorAction'/><menuitem name='RecipeGeneratorAction' action='RecipeGeneratorAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='ReactionStatusAction' action='ReactionStatusAction'/></menu><menu name='DebugAction' action='DebugAction'><menuitem name='ScreenshotAction' action='ScreenshotAction'/></menu></menubar></ui>");
 
		this.UIManager.AddUiFromString ("<ui><menubar name='menu'><menu name='FileAction' action='FileAction'><menu name='ProfileAction' action='ProfileAction'><menuitem name='NewProfileAction' action='NewProfileAction'/><menuitem name='OpenProfileAction' action='OpenProfileAction'/><menuitem name='ImportProfileAction' action='ImportProfileAction'/><menuitem name='ExportProfileAction' action='ExportProfileAction'/><menuitem name='ExportForPracticalPaintAction' action='ExportForPracticalPaintAction'/></menu><menu name='RecipesAction' action='RecipesAction'><menuitem name='ExportRecipesAction' action='ExportRecipesAction'/><menuitem name='CopyRecipesToClipboardAction' action='CopyRecipesToClipboardAction'/></menu><separator/><menuitem name='PreferencesAction' action='PreferencesAction'/><separator/><menuitem name='ExitAction' action='ExitAction'/></menu><menu name='ViewAction' action='ViewAction'><menuitem name='CaptureAction' action='CaptureAction'/><menuitem name='SimulatorAction' action='SimulatorAction'/><menuitem name='RecipeGeneratorAction' action='RecipeGeneratorAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='ReactionStatusAction' action='ReactionStatusAction'/></menu><menu name='DebugAction' action='DebugAction'><menuitem name='ScreenshotAction' action='ScreenshotAction'/></menu></menubar></ui>");
 
		this.menu = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menu")));
...
 
@@ -182,2 +187,3 @@ public partial class MainWindow
 
		this.ExportForPracticalPaintAction.Activated += new global::System.EventHandler (this.OnExportToPracticalPaint);
 
        this.PreferencesAction.Activated += new global::System.EventHandler(this.OnPreferences);
 
	}
gtk-gui/gui.stetic
Show inline comments
...
 
@@ -640,2 +640,14 @@ You can either import an existing Practi
 
            <child>
 
              <widget class="Gtk.Label" id="detectedResolutionLabel">
 
                <property name="MemberName" />
 
                <property name="LabelProp" translatable="yes">Detected Resolution</property>
 
              </widget>
 
              <packing>
 
                <property name="Position">0</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <placeholder />
...
 
@@ -1260,3 +1272,3 @@ You can either import an existing Practi
 
                    <property name="CanFocus">True</property>
 
                    <property name="Label" translatable="yes">Ribbon Recipes</property>
 
                    <property name="Label" translatable="yes">Silk Ribbon Recipes</property>
 
                    <property name="DrawIndicator">True</property>
0 comments (0 inline, 0 general)