Exemplo n.º 1
0
        public Typing(Mode mode, Cursor cursor)
        {
            switch (mode)
            {
            case Mode.typewriter:
                Type = TypeTypewriter;
                break;

            case Mode.keyboard:
                Type = TypeKeyboard;
                break;
            }
            switch (cursor)
            {
            case Cursor.invisible:
                Out = OutputWithNoCursor;
                break;

            case Cursor.visible:
                Out = OutputWithCursor;
                break;

            case Cursor.hangeul:
                Out = OutputWithCursorOnlyHangeul;
                break;
            }
        }
Exemplo n.º 2
0
        public static Item[] GetRegistryItems()
        {
            List <TMItem> tmItems = new List <TMItem>();

            foreach (PokemonMove move in PokemonMove.registry)
            {
                tmItems.Add(new TMItem
                {
                    id           = tmItemStart + move.id,
                    moveId       = move.id,
                    itemName     = "TM" + move.id + ' ' + move.name,
                    resourceName = "tm_" + TypeFunc.GetTypeResourceName(move.type),
                    description  = move.description
                });
            }

            return(tmItems.ToArray());
        }
Exemplo n.º 3
0
        public void Paint(GraphicsPath path, Graphics g, int time, float opacity)
        {
            int num1 = 0;
            int num2 = 0;
            GraphicsContainer container1 = g.BeginContainer();

            AnimFunc.CreateAnimateValues(this, time, out num1, out num2);
            g.SmoothingMode = base.OwnerDocument.SmoothingMode;
            bool  flag1   = this.Units == Units.UserSpaceOnUse;
            float single1 = this.X;
            float single2 = this.Y;
            float single3 = this.Width;
            float single4 = this.Height;

            ItopVector.Core.Types.ViewBox box1 = TypeFunc.ParseViewBox(this);
            Matrix matrix1 = new Matrix();

            if (box1 != null)
            {
                matrix1 = box1.GetViewMatrix(this);
            }
            RectangleF ef1 = path.GetBounds();

            if (!flag1)
            {
                single1 *= ef1.Width;
                single2 *= ef1.Height;
                single3  = (int)Math.Min((float)(single3 * ef1.Width), ef1.Width);
                single4  = (int)Math.Min((float)(single4 * ef1.Height), ef1.Height);
            }
            this.coord = matrix1.Clone();
            PointF[] tfArray1 = new PointF[7] {
                new PointF(single1 + (single3 / 2f), single2 + (single4 / 2f)), new PointF(single1, single2 + (single4 / 2f)), new PointF(single1 + single3, single2), new PointF(single1 + (single3 / 2f), single2), new PointF(single1 + single3, single2 + (single4 / 2f)), new PointF(single1 + (single3 / 2f), single2 + single4), new PointF(single1, single2 + single4)
            };
            this.boundsPoints = tfArray1;
            this.graidentPath = new GraphicsPath();
            this.graidentPath.AddRectangle(new RectangleF(single1, single2, single3, single4));
            Bitmap   bitmap1   = new Bitmap((int)single3, (int)single4);
            Graphics graphics1 = Graphics.FromImage(bitmap1);
            Matrix   matrix2   = matrix1.Clone();

            graphics1.Transform = matrix2;
            SvgElementCollection.ISvgElementEnumerator enumerator1 = this.graphList.GetEnumerator();
            while (enumerator1.MoveNext())
            {
                IGraph graph1 = (IGraph)enumerator1.Current;
                graph1.Draw(graphics1, time);
            }
            TextureBrush brush1 = new TextureBrush(bitmap1, new RectangleF(single1, single2, single3, single4));

            brush1.WrapMode  = WrapMode.Tile;
            brush1.Transform = this.Transform.Matrix;
            Matrix matrix3 = new Matrix(1f, 0f, 0f, 1f, ef1.X + (ef1.Width / 2f), ef1.Y + (ef1.Height / 2f));

            this.graidentPath.Transform(matrix3);
            matrix3.TransformPoints(this.boundsPoints);
            g.FillPath(brush1, path);
            bitmap1.Dispose();
            brush1.Dispose();
            g.EndContainer(container1);
        }
Exemplo n.º 4
0
 public static string GetPokemonMoveTypeFXClipName(Pokemon.Type type)
 => moveTypeFXClipPrefix + TypeFunc.GetTypeResourceName(type);
Exemplo n.º 5
0
 public static Sprite GetTypeParticleSprite(Pokemon.Type type)
 {
     return(GetSprite(SpriteType.TypeParticle,
                      typeParticlePrefix + TypeFunc.GetTypeResourceName(type)));
 }
Exemplo n.º 6
0
    private static Sprite[] LoadTypeParticleSprites()
    {
        List <Sprite> sprites = new List <Sprite>();

        foreach (Pokemon.Type type in Enum.GetValues(typeof(Pokemon.Type)))
        {
            if (type == Pokemon.Type.Normal)
            {
                continue;
            }

            string resourceName = spritesResourcesPrefix + typeParticlesPath + typeParticlePrefix + TypeFunc.GetTypeResourceName(type);

            Sprite typeParticleSprite = Resources.Load <Sprite>(resourceName);

            if (typeParticleSprite == null)
            {
                Debug.LogWarning("Unable to find sprite for type " + type);
                continue;
            }

            sprites.Add(typeParticleSprite);
        }

        return(sprites.ToArray());
    }
Exemplo n.º 7
0
 public static Sprite GetTypeSymbolSprite(Pokemon.Type type)
 {
     return(GetSprite(SpriteType.Symbol,
                      typeSymbolSpritePrefix + TypeFunc.GetTypeResourceName(type)));
 }
Exemplo n.º 8
0
    public static Sprite GetTMSprite(Pokemon.Type moveType)
    {
        string resourceName = tmItemSpritePrefix + TypeFunc.GetTypeResourceName(moveType);

        return(GetSprite(SpriteType.Item, resourceName));
    }
Exemplo n.º 9
0
        public override void Draw(Graphics g, int time)
        {
            float  single5;
            float  single6;
            float  single7;
            float  single8;
            float  single11;
            float  single12;
            float  single13;
            Matrix matrix1;

            ItopVector.Core.Types.ViewBox box1 = null;
            if (this.pretime != base.OwnerDocument.ControlTime)
            {
                box1         = TypeFunc.ParseViewBox(this);
                this.ViewBox = box1;
            }
            box1 = this.ViewBox;
            parAlign       align1  = parAlign.none;
            parMeetOrSlice slice1  = parMeetOrSlice.slice;
            float          single1 = this.Width;
            float          single2 = this.Height;
            float          single3 = 0f;
            float          single4 = 0f;

            if (box1 != null)
            {
                single1 = box1.width;
                single2 = box1.height;
                single3 = box1.min_x;
                single4 = box1.min_y;
                PreserveAspectRatio ratio1 = box1.psr;
                align1 = ratio1.Align;
                slice1 = ratio1.Mos;
            }
            float             single9    = this.width / single1;
            float             single10   = this.height / single2;
            GraphicsContainer container1 = g.BeginContainer();

            g.SmoothingMode = base.OwnerDocument.SmoothingMode;
            if (single9 >= single10)
            {
                single12 = single9;
                single13 = single10;
            }
            else
            {
                single12 = single10;
                single13 = single9;
            }
            if (slice1 == parMeetOrSlice.meet)
            {
                single11 = single13;
                single7  = single1 * single11;
                single8  = single2 * single11;
                switch (align1)
                {
                case parAlign.xMinYMin:
                {
                    single5 = this.X - single3;
                    single6 = this.Y - single4;
                    goto Label_03D1;
                }

                case parAlign.xMidYMin:
                {
                    single5 = ((this.Width - single7) / 2f) - single3;
                    single6 = this.Y - single4;
                    goto Label_03D1;
                }

                case parAlign.xMaxYMin:
                {
                    single5 = (this.Width - single7) - single3;
                    single6 = this.Y - single4;
                    goto Label_03D1;
                }

                case parAlign.xMinYMid:
                {
                    single5 = this.X - single3;
                    single6 = ((this.Height - single8) / 2f) - single4;
                    goto Label_03D1;
                }

                case parAlign.xMidYMid:
                {
                    single5 = ((this.Width - single7) / 2f) - single3;
                    single6 = ((this.Height - single8) / 2f) - single4;
                    goto Label_03D1;
                }

                case parAlign.xMaxYMid:
                {
                    single5 = (this.Width - single7) - single3;
                    single6 = ((this.Height - single8) / 2f) - single4;
                    goto Label_03D1;
                }

                case parAlign.xMinYMax:
                {
                    single5 = this.X - single3;
                    single6 = (this.Height - single8) - single4;
                    goto Label_03D1;
                }

                case parAlign.xMidYMax:
                {
                    single5 = ((this.Width - single7) / 2f) - single3;
                    single6 = (this.Height - single8) - single4;
                    goto Label_03D1;
                }

                case parAlign.xMaxYMax:
                {
                    single5 = (this.Width - single7) - single3;
                    single6 = (this.Height - single8) - single4;
                    goto Label_03D1;
                }
                }
                single5 = this.X - single3;
                single6 = this.Y - single4;
                single7 = single1;
                single8 = single2;
            }
            else
            {
                single11 = single12;
                single7  = this.Width / single11;
                single8  = this.Height / single11;
                switch (align1)
                {
                case parAlign.xMinYMin:
                {
                    single5 = this.X + single3;
                    single6 = this.Y + single4;
                    goto Label_03D1;
                }

                case parAlign.xMidYMin:
                {
                    single5 = ((single1 - single7) / 2f) + single3;
                    single6 = this.Y + single4;
                    goto Label_03D1;
                }

                case parAlign.xMaxYMin:
                {
                    single5 = (single1 - single7) + single3;
                    single6 = this.Y + single4;
                    goto Label_03D1;
                }

                case parAlign.xMinYMid:
                {
                    single5 = this.X + single3;
                    single6 = ((single2 - single8) / 2f) + single4;
                    goto Label_03D1;
                }

                case parAlign.xMidYMid:
                {
                    single5 = ((single1 - single7) / 2f) + single3;
                    single6 = ((single2 - single8) / 2f) + single4;
                    goto Label_03D1;
                }

                case parAlign.xMaxYMid:
                {
                    single5 = (single1 - single7) + single3;
                    single6 = ((single2 - single8) / 2f) + single4;
                    goto Label_03D1;
                }

                case parAlign.xMinYMax:
                {
                    single5 = this.X + single3;
                    single6 = (single2 - single8) + single4;
                    goto Label_03D1;
                }

                case parAlign.xMidYMax:
                {
                    single5 = ((single1 - single7) / 2f) + single3;
                    single6 = (single2 - single8) + single4;
                    goto Label_03D1;
                }

                case parAlign.xMaxYMax:
                {
                    single5 = (single1 - single7) + single3;
                    single6 = (single2 - single8) + single4;
                    goto Label_03D1;
                }
                }
                single5 = this.X + single3;
                single6 = this.Y + single4;
                single7 = single1;
                single8 = single2;
            }
Label_03D1:
            matrix1 = base.GraphTransform.Matrix;
            if ((this.Width != 0f) && (this.Height != 0f))
            {
                float single14 = this.width / single7;
                float single15 = this.height / single8;
//                g.ScaleTransform(single14, single15);
                matrix1.Scale(single14, single15);
            }
            if (base.OwnerDocument.DocumentElement == this)
            {
//              g.TranslateTransform(single5, single6);
                matrix1.Translate(single5, single6);
            }
            else
            {
//                g.TranslateTransform(single5 - this.x, single6 - this.y);
                matrix1.Translate(single5 - this.x, single6 - this.y);
            }
            foreach (Layer layer in OwnerDocument.Layers)
            {
                if (!layer.Visible)
                {
                    continue;
                }

                SvgElementCollection.ISvgElementEnumerator enumerator1 = layer.GraphList.GetEnumerator();
                contectbounds = RectangleF.Empty;
                while (enumerator1.MoveNext())
                {
                    IGraph graph1 = (IGraph)enumerator1.Current;
                    graph1.ShowConnectPoints = base.OwnerDocument.ShowConnectPoints;
                    try
                    {
                        //						if(graph1.LimitSize)
                        //						{
                        //							PointF [] points = {new PointF( matrix1.OffsetX,matrix1.OffsetY)};
                        //							matrix1.TransformVectors(points);
                        //							graph1.GraphTransform.Matrix = new Matrix(1,0,0,1,points[0].X,points[0].Y);
                        //						}
                        //						else
                        graph1.GraphTransform.Matrix = matrix1.Clone();
                        using (Matrix matrix2 = new Matrix())
                        {
                            if (graph1 is ConnectLine)
                            {
                                graph1.Draw(g, time); continue;
                            }
                            matrix2.Multiply(matrix1, MatrixOrder.Prepend);
                            matrix2.Multiply(graph1.Transform.Matrix, MatrixOrder.Prepend);
                            //(graph1 as ConnectLine).UpatePath(g);
                            RectangleF rtf1 = graph1.GPath.GetBounds(matrix2);
                            if (!(graph1 is Text))
                            {
                                rtf1.Width++; rtf1.Height++;
                            }
                            if (g.IsVisible(rtf1) || (rtf1 == RectangleF.Empty) || (graph1 is ConnectLine && graph1.GPath.PointCount == 0))
                            {
                                graph1.Draw(g, time);
                            }
                            else
                            {
                                graph1.GraphTransform.Matrix.Multiply(graph1.Transform.Matrix, MatrixOrder.Prepend);
#if debug
                                int i = 0;
                                i++;
#endif
                            }
                        }
                    }
                    catch (Exception e)
                    {
                    }
                    finally
                    {
                        graph1 = null;
                    }
                }
            }
            this.pretime = time;
            g.EndContainer(container1);
        }