// Token: 0x06001726 RID: 5926 RVA: 0x00037F30 File Offset: 0x00036130
        private void method_1()
        {
            this.method_0();
            Point point = new Point(base.Width / 2, base.Height / 2);

            for (int i = 0; i < this.int_0; i++)
            {
                double num      = Class477.smethod_11((double)((360 / this.int_0 * i + this.int_3) % 360));
                int    num2     = Math.Min(base.Width - this.size_0.Width - base.Margin.Horizontal, base.Height - this.size_0.Height - base.Margin.Vertical) / 2;
                Point  point_   = new Point((int)Math.Round((double)point.X + (double)num2 * Math.Cos(num)), (int)Math.Round((double)point.Y + (double)num2 * Math.Sin(num)));
                Point  location = new Point(point_.X - this.size_0.Width / 2, point_.Y - this.size_0.Height / 2);
                ProgressDots.Class158 @class = null;
                try
                {
                    @class                = new ProgressDots.Class158();
                    @class.rectangle_0    = new Rectangle(location, this.size_0);
                    @class.graphicsPath_0 = new GraphicsPath();
                    @class.graphicsPath_0.AddEllipse(@class.rectangle_0);
                    @class.point_0 = point_;
                    this.list_0.Add(@class);
                }
                catch (Exception ex)
                {
                    if (@class != null)
                    {
                        @class.Dispose();
                    }
                    @class = null;
                    ex.smethod_0();
                }
            }
            this.method_2();
        }
Beispiel #2
0
 private void method_20()
 {
     if (this.bool_1)
     {
         RowFormat rowFormat = this.table_0.FirstRow.RowFormat;
         this.bool_3 = rowFormat.HasKey(0xfdc);
         this.bool_4 = rowFormat.HasKey(0xff0);
         this.bool_5 = rowFormat.HasKey(0xfd2);
         this.bool_6 = rowFormat.HasKey(0xfe6);
         this.bool_7 = rowFormat.HasKey(0xffa);
         this.bool_8 = rowFormat.HasKey(0x1004);
         Border border = new Border {
             BorderType = BorderStyle.None,
             LineWidth  = 0f,
             Color      = Color.Empty
         };
         bool flag = (((this.bool_3 || this.bool_4) || (this.bool_5 || this.bool_6)) || this.bool_7) || this.bool_8;
         this.border_0 = flag ? border : null;
     }
     for (int i = 0; i < this.class982_0.Count; i++)
     {
         Class477 class2 = this.class982_0.method_0(i);
         for (int j = 0; this.method_21(class2.method_1()[j], i, j); j++)
         {
         }
         for (int k = this.method_9() - 1; this.method_21(class2.method_1()[k], i, k); k--)
         {
         }
     }
 }
Beispiel #3
0
        // Token: 0x06001BF1 RID: 7153 RVA: 0x00057754 File Offset: 0x00055954
        public static float?smethod_0(PointF sphereCenter, float sphereRadius, PointF rayPosition, float rayAngle)
        {
            double num    = Class477.smethod_11((double)rayAngle);
            PointF pointF = new PointF(-(float)Math.Sin(num), (float)Math.Cos(num));

            pointF.smethod_1();
            return(Class237.smethod_1(sphereCenter, sphereRadius, rayPosition, pointF));
        }
Beispiel #4
0
        // Token: 0x06002D1E RID: 11550 RVA: 0x000AE098 File Offset: 0x000AC298
        public unsafe static int smethod_2(Class150 left, Class150 right, int x_pixel_offset, int y_pixel_offset)
        {
            int result;

            lock (right.object_0)
            {
                lock (left.object_0)
                {
                    uint      num    = 0U;
                    Size      size   = left.size_0;
                    Struct33 *pBase  = left.class125_0.pBase;
                    Struct33 *pBase2 = right.class125_0.pBase;
                    int       num2;
                    int       num3;
                    if (x_pixel_offset > 0)
                    {
                        num2 = x_pixel_offset;
                        num3 = 0;
                    }
                    else
                    {
                        x_pixel_offset = Math.Abs(x_pixel_offset);
                        num3           = x_pixel_offset;
                        num2           = 0;
                    }
                    int num4;
                    int num5;
                    if (y_pixel_offset > 0)
                    {
                        num4 = y_pixel_offset;
                        num5 = 0;
                    }
                    else
                    {
                        y_pixel_offset = Math.Abs(y_pixel_offset);
                        num5           = y_pixel_offset;
                        num4           = 0;
                    }
                    int i = y_pixel_offset;
                    while (i < size.Height)
                    {
                        Struct33 *ptr  = pBase + num4 * size.Width + num2;
                        Struct33 *ptr2 = pBase2 + num5 * size.Width + num3;
                        for (int j = x_pixel_offset; j < size.Width; j++)
                        {
                            num = num + Class477.smethod_8((int)ptr->R, (int)ptr2->R) + Class477.smethod_8((int)ptr->G, (int)ptr2->G) + Class477.smethod_8((int)ptr->B, (int)ptr2->B);
                            ptr++;
                            ptr2++;
                        }
                        i++;
                        num4++;
                        num5++;
                    }
                    result = (int)(num / ((size.Width - x_pixel_offset) * (size.Height - y_pixel_offset) * 3m));
                }
            }
            return(result);
        }
        // Token: 0x06001D7E RID: 7550 RVA: 0x0005EF78 File Offset: 0x0005D178
        public static List <PointF> smethod_22(HashSet <PointF> points, PointF initial_location, PointF end_location)
        {
            List <PointF> list = new List <PointF>();
            float         num  = Class477.smethod_9(initial_location, end_location);
            PointF        p    = initial_location;

            if (points != null)
            {
                for (;;)
                {
                    PointF?pointF = null;
                    float  num2   = num;
                    float  num3   = num;
                    foreach (PointF pointF2 in points)
                    {
                        float num4 = Class477.smethod_9(pointF2, end_location);
                        if (num4 < num)
                        {
                            float num5 = Class477.smethod_9(p, pointF2);
                            if (num5 < num3 && pointF2 != initial_location && pointF2 != end_location)
                            {
                                num3   = num5;
                                num2   = num4;
                                pointF = new PointF?(pointF2);
                            }
                        }
                    }
                    if (pointF == null)
                    {
                        break;
                    }
                    num = num2;
                    PointF value = pointF.Value;
                    list.Add(value);
                    points.Remove(value);
                    p = value;
                }
            }
            list.Add(end_location);
            return(list);
        }
Beispiel #6
0
    private void method_17(Class477 A_0)
    {
        int num  = smethod_2(A_0.method_0());
        int num2 = this.class656_0.method_14(num);

        for (int i = 0; i < num2; i++)
        {
            A_0.method_1()[i] = Class925.smethod_2();
        }
        int num6 = smethod_3(A_0.method_0(), A_0.method_0().Cells.Count);
        int num4 = this.class656_0.method_14(num6);

        for (int j = num4; j < this.method_9(); j++)
        {
            A_0.method_1()[j] = Class925.smethod_2();
        }
        if ((num2 > 0) || (num4 < this.method_9()))
        {
            this.bool_9  = true;
            this.bool_10 = true;
        }
    }
Beispiel #7
0
    private void method_14()
    {
        RowCollection rows  = this.table_0.Rows;
        int           count = rows.Count;

        for (int i = 0; i < count; i++)
        {
            Class477 class2 = new Class477(this.method_9(), rows[i]);
            this.class982_0.Add(class2);
            this.method_17(class2);
            CellCollection cells = class2.method_0().Cells;
            int            num9  = cells.Count;
            for (int j = 0; j < num9; j++)
            {
                int        num4       = 0;
                float      width      = 0f;
                Section    section    = this.table_0.method_55();
                TableCell  cell4      = cells[j];
                CellFormat cellFormat = cell4.CellFormat;
                if (((cell4.CellWidthType == CellWidthType.Auto) && (cellFormat.HorizontalMerge != CellMerge.Continue)) && (cellFormat.VerticalMerge != CellMerge.Continue))
                {
                    if (this.table_0.PreferredTableWidth.method_51() == FtsWidth.Percentage)
                    {
                        if (this.table_0.IsInCell)
                        {
                            TableCell owner = this.table_0.Owner as TableCell;
                            if (owner.CellWidthType == CellWidthType.Percentage)
                            {
                                float num15 = owner.CellFormat.SamePaddingsAsTable ? owner.OwnerRow.OwnerTable.TableFormat.Paddings.PaddingWidth : owner.CellFormat.Paddings.PaddingWidth;
                                width = ((owner.Scaling / 100f) * section.PageSetup.ClientWidth) - num15;
                            }
                            else if (owner.CellWidthType == CellWidthType.Auto)
                            {
                                width = section.PageSetup.ClientWidth - this.table_0.TableFormat.Paddings.PaddingWidth;
                            }
                            else
                            {
                                width = owner.Width;
                            }
                        }
                        else
                        {
                            width = (section.PageSetup.ClientWidth * this.table_0.PreferredTableWidth.method_49()) / 100f;
                        }
                    }
                    else if (this.table_0.PreferredTableWidth.method_51() == FtsWidth.Auto)
                    {
                        if (this.table_0.IsInCell)
                        {
                            TableCell cell2 = this.table_0.Owner as TableCell;
                            if (cell2.CellWidthType == CellWidthType.Percentage)
                            {
                                float num11 = cell2.CellFormat.SamePaddingsAsTable ? cell2.OwnerRow.OwnerTable.TableFormat.Paddings.PaddingWidth : cell2.CellFormat.Paddings.PaddingWidth;
                                width = ((cell2.Scaling / 100f) * section.PageSetup.ClientWidth) - num11;
                            }
                            else if (cell2.CellWidthType == CellWidthType.Auto)
                            {
                                width = section.PageSetup.ClientWidth - this.table_0.TableFormat.Paddings.PaddingWidth;
                            }
                            else
                            {
                                width = cell2.Width;
                            }
                        }
                        else
                        {
                            width = section.PageSetup.ClientWidth - this.table_0.TableFormat.Paddings.PaddingWidth;
                        }
                    }
                    else
                    {
                        width = this.table_0.PreferredTableWidth.method_49();
                    }
                    num4 = (int)((width / ((float)num9)) * 20f);
                }
                else if (cell4.CellWidthType == CellWidthType.Percentage)
                {
                    if (this.table_0.PreferredTableWidth.method_51() == FtsWidth.Percentage)
                    {
                        if (this.table_0.IsInCell)
                        {
                            TableCell cell7 = this.table_0.Owner as TableCell;
                            if (cell7.CellWidthType == CellWidthType.Percentage)
                            {
                                float num17 = cell7.CellFormat.SamePaddingsAsTable ? cell7.OwnerRow.OwnerTable.TableFormat.Paddings.PaddingWidth : cell7.CellFormat.Paddings.PaddingWidth;
                                width = ((cell7.Scaling / 100f) * section.PageSetup.ClientWidth) - num17;
                            }
                            else if (cell7.CellWidthType == CellWidthType.Auto)
                            {
                                width = section.PageSetup.ClientWidth - this.table_0.TableFormat.Paddings.PaddingWidth;
                            }
                            else
                            {
                                width = cell7.Width;
                            }
                        }
                        else
                        {
                            width = (section.PageSetup.ClientWidth * this.table_0.PreferredTableWidth.method_49()) / 100f;
                        }
                    }
                    else if (this.table_0.PreferredTableWidth.method_51() == FtsWidth.Auto)
                    {
                        if (this.table_0.IsInCell)
                        {
                            TableCell cell = this.table_0.Owner as TableCell;
                            if (cell.CellWidthType == CellWidthType.Percentage)
                            {
                                float num16 = cell.CellFormat.SamePaddingsAsTable ? cell.OwnerRow.OwnerTable.TableFormat.Paddings.PaddingWidth : cell.CellFormat.Paddings.PaddingWidth;
                                width = ((cell.Scaling / 100f) * section.PageSetup.ClientWidth) - num16;
                            }
                            else if (cell.CellWidthType == CellWidthType.Auto)
                            {
                                width = section.PageSetup.ClientWidth - this.table_0.TableFormat.Paddings.PaddingWidth;
                            }
                            else
                            {
                                width = cell.Width;
                            }
                        }
                        else
                        {
                            width = section.PageSetup.ClientWidth - this.table_0.TableFormat.Paddings.PaddingWidth;
                        }
                    }
                    else
                    {
                        width = this.table_0.PreferredTableWidth.method_49();
                    }
                    num4 = (int)(((cell4.Scaling * width) / 100f) * 20f);
                }
                else
                {
                    num4 = (int)(cellFormat.CellWidthEx * 20f);
                }
                if (((cellFormat.HorizontalMerge != CellMerge.Continue) && (cellFormat.VerticalMerge != CellMerge.Continue)) || (num4 != 0))
                {
                    Class925 class3 = Class925.smethod_0(cellFormat, cell4);
                    int      num12  = smethod_3(class2.method_0(), j);
                    int      index  = this.class656_0.method_14(num12);
                    int      num13  = num12 + num4;
                    int      num6   = this.class656_0.method_14(num13);
                    class2.method_1()[index] = class3;
                    TableCell cell6 = cell4;
                    TableCell cell5 = cell4;
                    if (cellFormat.HorizontalMerge == CellMerge.Start)
                    {
                        for (int m = j + 1; m < num9; m++)
                        {
                            TableCell cell8 = cells[m];
                            if (cell8.CellFormat.HorizontalMerge != CellMerge.Continue)
                            {
                                break;
                            }
                            cell6 = cell8;
                        }
                    }
                    if (cellFormat.VerticalMerge == CellMerge.Start)
                    {
                        for (int n = i + 1; n < count; n++)
                        {
                            TableCell cell9 = smethod_4(rows[n], num12);
                            if ((cell9 == null) || (cell9.CellFormat.VerticalMerge != CellMerge.Continue))
                            {
                                break;
                            }
                            cell5 = cell9;
                        }
                    }
                    CellFormat format2 = class3.method_0();
                    this.method_15(format2, cell4, 0xc26);
                    this.method_15(format2, cell4, 0xc30);
                    this.method_15(format2, cell5, 0xc3a);
                    this.method_15(format2, cell6, 0xc44);
                    this.method_15(format2, cell4, 0xc4e);
                    this.method_15(format2, cell4, 0xc58);
                    this.method_16(format2, cell4, 0xbfe);
                    this.method_16(format2, cell4, 0xc12);
                    this.method_16(format2, cell4, 0xc08);
                    this.method_16(format2, cell4, 0xc1c);
                    for (int k = index + 1; k < num6; k++)
                    {
                        class2.method_1()[k] = Class925.smethod_1(format2, cell4);
                    }
                    if ((num6 - index) > 1)
                    {
                        this.bool_9 = true;
                    }
                }
            }
        }
    }
Beispiel #8
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);
        }
 public abstract void Visit(Class477 c);
 public override void Visit(Class477 c) { }
        // Token: 0x06001D6D RID: 7533 RVA: 0x0005E7C8 File Offset: 0x0005C9C8
        public static bool smethod_5(Class142 toontownWindow, ManualResetEventSlim waitHandle, ManualResetEventSlim navigateWaitHandle, Class104 settings, PointF target, bool jump, bool finalTarget)
        {
            Class269.Class278 @class           = new Class269.Class278();
            IntPtr            mainWindowHandle = toontownWindow.ToonTownProcess.MainWindowHandle;

            if (!toontownWindow.ToonTownProcess.ProcessOpen)
            {
                return(false);
            }
            Class269.Enum58 @enum = Class269.Enum58.flag_0;
            @class.struct56_0 = Struct56.struct56_0;
            Struct56 a   = Struct56.struct56_0;
            DateTime t   = DateTime.Now.AddMilliseconds(2000.0);
            float    num = finalTarget ? settings.TargetRange : settings.IntermediateTargetRange;

            @class.bool_0 = false;
            EventHandler <EventArgs22> eventHandler = null;

            Class269.Class279 class2 = new Class269.Class279();
            class2.class278_0             = @class;
            class2.manualResetEventSlim_0 = new ManualResetEventSlim(false);
            try
            {
                try
                {
                    Class129 logMonitor = toontownWindow.LogMonitor;
                    if (eventHandler == null)
                    {
                        eventHandler = new EventHandler <EventArgs22>(class2.method_0);
                    }
                    logMonitor.CoordinatesChanged += eventHandler;
                    WaitHandle[] waitHandles = new WaitHandle[]
                    {
                        waitHandle.WaitHandle,
                        class2.manualResetEventSlim_0.WaitHandle,
                        navigateWaitHandle.WaitHandle
                    };
                    WaitHandle.WaitAny(waitHandles);
                    WaitHandle[] waitHandles2 = new WaitHandle[]
                    {
                        waitHandle.WaitHandle,
                        navigateWaitHandle.WaitHandle
                    };
                    DateTime t2 = DateTime.Now.AddMilliseconds(2000.0);
                    try
                    {
                        while (!waitHandle.IsSet && !navigateWaitHandle.IsSet)
                        {
                            Struct56 struct56_ = @class.struct56_0;
                            PointF   location  = struct56_.Location;
                            if (Class477.smethod_0(target, num, location))
                            {
                                return(true);
                            }
                            float num2 = struct56_.method_0(target);
                            float num3 = Math.Abs(num2 - struct56_.float_3);
                            float num4 = Class477.smethod_9(target, struct56_.Location);
                            if (t < DateTime.Now)
                            {
                                if (Struct56.smethod_0(a, struct56_))
                                {
                                    Class269.smethod_16(mainWindowHandle, ref @enum);
                                    Class269.smethod_15(mainWindowHandle, ref @enum);
                                    Class269.smethod_14(mainWindowHandle, ref @enum);
                                    Class269.smethod_19(mainWindowHandle);
                                }
                                t = DateTime.Now.AddMilliseconds(2000.0);
                            }
                            bool flag2;
                            if ((num4 > 20f && num3 > 20f) || (num4 <= 20f && Class237.smethod_0(target, num, location, struct56_.float_3) == null))
                            {
                                Class269.smethod_16(mainWindowHandle, ref @enum);
                                bool flag = num3 > 180f;
                                if (num2 < struct56_.float_3)
                                {
                                    if (flag)
                                    {
                                        flag2 = Class269.smethod_9(mainWindowHandle, ref @enum, waitHandles2, num3);
                                    }
                                    else
                                    {
                                        flag2 = Class269.smethod_10(mainWindowHandle, ref @enum, waitHandles2, num3);
                                    }
                                }
                                else if (flag)
                                {
                                    flag2 = Class269.smethod_10(mainWindowHandle, ref @enum, waitHandles2, num3);
                                }
                                else
                                {
                                    flag2 = Class269.smethod_9(mainWindowHandle, ref @enum, waitHandles2, num3);
                                }
                            }
                            else
                            {
                                Class269.smethod_15(mainWindowHandle, ref @enum);
                                Class269.smethod_14(mainWindowHandle, ref @enum);
                                if (jump && t2 < DateTime.Now)
                                {
                                    Class269.smethod_18(mainWindowHandle, waitHandles2);
                                    t2 = DateTime.Now.AddMilliseconds(2000.0);
                                }
                                flag2 = Class269.smethod_11(mainWindowHandle, ref @enum, waitHandles2, num4 - settings.TargetRange);
                            }
                            if (!flag2)
                            {
                                class2.manualResetEventSlim_0.Reset();
                                WaitHandle.WaitAny(waitHandles);
                            }
                            if (Class477.smethod_0(target, num, @class.struct56_0.Location))
                            {
                                return(true);
                            }
                            WaitHandle.WaitAny(waitHandles2, 25);
                            a = struct56_;
                        }
                    }
                    finally
                    {
                        Class269.smethod_16(mainWindowHandle, ref @enum);
                        Class269.smethod_15(mainWindowHandle, ref @enum);
                        Class269.smethod_14(mainWindowHandle, ref @enum);
                        Class269.smethod_19(mainWindowHandle);
                    }
                }
                finally
                {
                    @class.bool_0 = true;
                }
            }
            finally
            {
                if (class2.manualResetEventSlim_0 != null)
                {
                    ((IDisposable)class2.manualResetEventSlim_0).Dispose();
                }
            }
            return(false);
        }
Beispiel #12
0
 public void method_1(int A_0, Class477 A_1)
 {
     base[A_0] = A_1;
 }