// Token: 0x0600215C RID: 8540 RVA: 0x0000DB03 File Offset: 0x0000BD03
 public static void smethod_20(this BinaryWriter writer, Struct46 fbr)
 {
     writer.Write(fbr.double_0);
     writer.Write(fbr.double_1);
     writer.Write(fbr.double_2);
     writer.Write(fbr.double_3);
 }
        // Token: 0x060017A0 RID: 6048 RVA: 0x0003DF3C File Offset: 0x0003C13C
        protected Enum107 method_20(int interval, Class150 original_capture, Struct46 bounds, Class104 settings, ManualResetEventSlim waitHandle = null)
        {
            while (!this.manualResetEventSlim_0.IsSet && (waitHandle == null || !waitHandle.IsSet))
            {
                this.method_7();
                switch (Class433.smethod_0(this.class142_0.ToonTownProcess, original_capture, bounds, settings))
                {
                case Enum107.const_0:
                    return(Enum107.const_0);

                case Enum107.const_1:
                    if (waitHandle == null)
                    {
                        this.manualResetEventSlim_0.Wait(interval);
                    }
                    else
                    {
                        WaitHandle.WaitAny(new WaitHandle[]
                        {
                            this.manualResetEventSlim_0.WaitHandle,
                            waitHandle.WaitHandle
                        }, interval);
                    }
                    break;

                case Enum107.const_2:
                    return(Enum107.const_2);
                }
            }
            return(Enum107.const_1);
        }
 // Token: 0x0600179D RID: 6045 RVA: 0x00007532 File Offset: 0x00005732
 protected void method_17(Struct46 bounds, Class104 settings)
 {
     this.method_7();
     this.method_11(bounds);
     this.manualResetEventSlim_0.Wait(settings.AfterMoveBeforeClickDelay);
     this.method_18(settings);
 }
Ejemplo n.º 4
0
        // Token: 0x0600280B RID: 10251 RVA: 0x00093E4C File Offset: 0x0009204C
        public static Enum107 smethod_0(Class141 toontownWindow, Class150 original_capture, Struct46 bounds, Class104 settings)
        {
            if (original_capture == null)
            {
                return(Enum107.const_2);
            }
            if (bounds.IsSizeEmpty)
            {
                return(Enum107.const_2);
            }
            IntPtr mainWindowHandle = toontownWindow.MainWindowHandle;

            if (!toontownWindow.ProcessOpen)
            {
                return(Enum107.const_2);
            }
            if (original_capture != null && !Struct46.smethod_0(bounds, Struct46.struct46_0))
            {
                Rectangle rec = bounds.method_0(Class410.smethod_16(mainWindowHandle).Size);
                Enum107   result;
                using (Bitmap bitmap = Class364.smethod_3(mainWindowHandle, rec))
                {
                    using (Class125 @class = new Class125(bitmap))
                    {
                        using (Class150 class2 = new Class150(@class))
                        {
                            if (Class150.smethod_1(class2, original_capture, settings.MaxColorRange))
                            {
                                result = Enum107.const_0;
                            }
                            else
                            {
                                result = Enum107.const_1;
                            }
                        }
                    }
                }
                return(result);
            }
            return(Enum107.const_2);
        }
 // Token: 0x0600172D RID: 5933 RVA: 0x0003824C File Offset: 0x0003644C
 protected bool method_10(string message, string question, Struct46 ratio, out Class125 bmp, out Struct46 resulting_ratio)
 {
     bmp             = null;
     resulting_ratio = default(Struct46);
     if (!this.class141_0.ProcessOpen && !this.class141_0.smethod_1(this))
     {
         return(false);
     }
     using (Class499 @class = new Class499(this, true))
     {
         using (DialogBox dialogBox = new DialogBox(question, "Are you ready?", Enum90.const_0, null, false, Enum121.const_1, new Enum39[]
         {
             Enum39.const_0,
             Enum39.const_1
         }))
         {
             @class.method_1(dialogBox, DialogResult.OK);
             DialogResult dialogResult = dialogBox.ShowDialog();
             if (dialogResult != DialogResult.OK)
             {
                 return(false);
             }
             @class.method_4();
             @class.method_6();
         }
         if (this.class141_0.ProcessOpen)
         {
             Class410.smethod_8(this, this.class141_0.MainWindowHandle);
             using (CountDown countDown = new CountDown())
             {
                 @class.method_1(countDown, DialogResult.OK);
                 if (countDown.ShowDialog() == DialogResult.OK)
                 {
                     @class.method_6();
                     @class.method_4();
                     if (this.class141_0.ProcessOpen)
                     {
                         Class410.smethod_8(this, this.class141_0.MainWindowHandle);
                         EventHandler eventHandler        = null;
                         CaptureSetupForm.Class159 class2 = new CaptureSetupForm.Class159();
                         class2.regionSelector_0 = new RegionSelector(this.class141_0.MainWindowHandle);
                         try
                         {
                             @class.method_0(class2.regionSelector_0);
                             Rectangle rectangle = Class410.smethod_16(this.class141_0.MainWindowHandle);
                             class2.regionSelector_0.SelectionBounds      = Rectangle.Empty;
                             class2.regionSelector_0.SelectedRegion       = ratio.method_0(rectangle.Size);
                             class2.regionSelector_0.RegionSelectorType   = Enum124.const_0;
                             class2.regionSelector_0.FullSelect           = false;
                             class2.regionSelector_0.FullSize             = true;
                             class2.regionSelector_0.FullScreenCapture    = true;
                             class2.regionSelector_0.MovableResizeMessage = message + " Press any key to accept or escape to cancel.";
                             Form regionSelector_ = class2.regionSelector_0;
                             if (eventHandler == null)
                             {
                                 eventHandler = new EventHandler(class2.method_0);
                             }
                             regionSelector_.Shown += eventHandler;
                             if (class2.regionSelector_0.ShowDialog() == DialogResult.OK && class2.regionSelector_0.SelectedRegion.smethod_2())
                             {
                                 bmp             = class2.regionSelector_0.SelectedBitmap;
                                 resulting_ratio = Struct46.smethod_3(class2.regionSelector_0.SelectedRegion, new Rectangle(Point.Empty, rectangle.Size));
                                 return(true);
                             }
                         }
                         finally
                         {
                             if (class2.regionSelector_0 != null)
                             {
                                 ((IDisposable)class2.regionSelector_0).Dispose();
                             }
                         }
                     }
                 }
             }
         }
     }
     return(false);
 }
Ejemplo n.º 6
0
        // Token: 0x06002D1C RID: 11548 RVA: 0x000ADB68 File Offset: 0x000ABD68
        public unsafe static bool smethod_0(Class150 source, Struct46 sourceRatio, Class150 value, Struct46 valueRatio, int max_diff, out Point location)
        {
            int num  = (int)((double)source.size_0.Width / sourceRatio.double_2);
            int num2 = (int)((double)source.size_0.Height / sourceRatio.double_3);
            int num3 = (int)((double)value.size_0.Width / valueRatio.double_2);
            int num4 = (int)((double)value.size_0.Height / valueRatio.double_3);
            int num5;

            if (num > num3)
            {
                num5 = num3;
            }
            else
            {
                num5 = num;
            }
            int num6;

            if (num2 > num4)
            {
                num6 = num4;
            }
            else
            {
                num6 = num2;
            }
            Size sz  = new Size((int)Math.Round(sourceRatio.double_2 * (double)num5), (int)Math.Round(sourceRatio.double_3 * (double)num6));
            Size sz2 = new Size((int)Math.Round(valueRatio.double_2 * (double)num5), (int)Math.Round(valueRatio.double_3 * (double)num6));

            if (sz2.Width <= sz.Width && sz2.Height <= sz.Height)
            {
                Class150 @class = source.method_5(sz);
                Class150 class2 = value.method_5(sz2);
                lock (@class.object_0)
                {
                    lock (class2.object_0)
                    {
                        Struct33 *pBase  = @class.class125_0.pBase;
                        Struct33 *pBase2 = class2.class125_0.pBase;
                        decimal   d      = sz2.Width * sz2.Height * 3m;
                        for (int i = 0; i < sz.Height - sz2.Height; i++)
                        {
                            for (int j = 0; j < sz.Width - sz2.Width; j++)
                            {
                                Struct33 *ptr  = pBase2;
                                uint      num7 = 0U;
                                int       num8 = j + sz2.Width;
                                for (int k = i; k < i + sz2.Height; k++)
                                {
                                    Struct33 *ptr2 = pBase + k * sz.Width + j;
                                    for (int l = j; l < num8; l++)
                                    {
                                        num7 = num7 + Class477.smethod_8((int)ptr2->R, (int)ptr->R) + Class477.smethod_8((int)ptr2->G, (int)ptr->G) + Class477.smethod_8((int)ptr2->B, (int)ptr->B);
                                        ptr2++;
                                        ptr++;
                                    }
                                    if (num7 / d > max_diff)
                                    {
                                        break;
                                    }
                                }
                                if (num7 / d < max_diff)
                                {
                                    location = new Point((int)Math.Round((double)j / (double)sz.Width * (double)source.size_0.Width), (int)Math.Round((double)i / (double)sz.Height * (double)source.size_0.Height));
                                    return(true);
                                }
                            }
                        }
                    }
                }
                location = Point.Empty;
                return(false);
            }
            location = Point.Empty;
            return(false);
        }
        // Token: 0x0600179F RID: 6047 RVA: 0x0003DE78 File Offset: 0x0003C078
        protected Enum107 method_19(int interval, int timeout, Class150 original_capture, Struct46 bounds, Class104 settings)
        {
            RunBaseForm.Class163 @class = new RunBaseForm.Class163();
            @class.int_0 = timeout;
            Action action = null;

            RunBaseForm.Class164 class2 = new RunBaseForm.Class164();
            class2.class163_0             = @class;
            class2.manualResetEventSlim_0 = new ManualResetEventSlim(false);
            Enum107 result;

            try
            {
                if (action == null)
                {
                    action = new Action(class2.method_0);
                }
                using (Task task = new Task(action))
                {
                    try
                    {
                        task.Start();
                        result = this.method_20(interval, original_capture, bounds, settings, class2.manualResetEventSlim_0);
                    }
                    finally
                    {
                        class2.manualResetEventSlim_0.Set();
                        task.Wait();
                    }
                }
            }
            finally
            {
                if (class2.manualResetEventSlim_0 != null)
                {
                    ((IDisposable)class2.manualResetEventSlim_0).Dispose();
                }
            }
            return(result);
        }
 // Token: 0x06001798 RID: 6040 RVA: 0x000074C2 File Offset: 0x000056C2
 protected void method_12(Rectangle window_bounds, Struct46 bounds)
 {
     this.method_13(window_bounds, bounds.method_0(window_bounds.Size).smethod_9());
 }
 // Token: 0x06001797 RID: 6039 RVA: 0x000074AE File Offset: 0x000056AE
 protected void method_11(Struct46 bounds)
 {
     this.method_12(Class410.smethod_16(this.intptr_0), bounds);
 }