コード例 #1
0
        public override void Draw()
        {
            if (BodyLibrary == null)
            {
                return;
            }

            int drawIndex;

            if (Item.Info.Effect == ItemEffect.Gold)
            {
                if (Item.Count < 100)
                {
                    drawIndex = 120;
                }
                else if (Item.Count < 200)
                {
                    drawIndex = 121;
                }
                else if (Item.Count < 500)
                {
                    drawIndex = 122;
                }
                else if (Item.Count < 1000)
                {
                    drawIndex = 123;
                }
                else if (Item.Count < 1000000) //1 Million
                {
                    drawIndex = 124;
                }
                else if (Item.Count < 5000000) //5 Million
                {
                    drawIndex = 125;
                }
                else if (Item.Count < 10000000) //10 Million
                {
                    drawIndex = 126;
                }
                else
                {
                    drawIndex = 127;
                }
            }
            else
            {
                ItemInfo info = Item.Info;

                if (info.Effect == ItemEffect.ItemPart)
                {
                    info = Globals.ItemInfoList.Binding.First(x => x.Index == Item.AddedStats[Stat.ItemIndex]);
                }

                drawIndex = info.Image;
            }

            Size size = BodyLibrary.GetSize(drawIndex);

            BodyLibrary.Draw(drawIndex, DrawX + (CellWidth - size.Width) / 2, DrawY + (CellHeight - size.Height) / 2, DrawColour, false, 1F, ImageType.Image);
        }
コード例 #2
0
ファイル: Particle.cs プロジェクト: mrgreaper/mir3insanity
 public ParticleImageInfo(LibraryFile file, int index)
 {
     Index = index;
     if (CEnvir.LibraryList.TryGetValue(file, out Library))
     {
         Size = Library.GetSize(index);
     }
 }
コード例 #3
0
ファイル: DamageInfo.cs プロジェクト: ArturToJa/Lom3
        public void Draw(int drawX, int drawY)
        {
            if (Library == null)
            {
                return;
            }


            drawY -= DrawY + 20;

            drawX += 24;
            Size size;

            if (Value == 0)
            {
                if (Miss)
                {
                    size   = Library.GetSize(76);
                    drawX -= size.Width / 2;

                    Library.Draw(76, drawX, drawY, Color.White, false, Opacity, ImageType.Image);
                }
                else
                if (Block)
                {
                    size   = Library.GetSize(77);
                    drawX -= size.Width / 2;

                    Library.Draw(77, drawX, drawY, Color.White, false, Opacity, ImageType.Image);
                }

                //Block
            }
            else
            {
                string text = Value.ToString("+#0;-#0");



                int index;
                int width;
                if (Value <= -1000)
                {
                    //White
                    index = WhiteIndex;
                    width = WhiteWidth;
                }
                else if (Value <= -500)
                {
                    //Orange
                    index = OrangeIndex;
                    width = OrangeWidth;
                }
                else if (Value <= -100)
                {
                    //Green
                    index = GreenIndex;
                    width = GreenWidth;
                }
                else if (Value < 0)
                {
                    //Red
                    index = RedIndex;
                    width = RedWidth;
                }
                else
                {
                    //Blue
                    index = BlueIndex;
                    width = BlueWidth;
                }
                drawX -= width * text.Length / 2;

                if (Critical && Value < 0)
                {
                    size   = Library.GetSize(78);
                    drawX -= size.Width / 2;

                    Library.Draw(78, drawX, drawY, Color.White, false, Opacity, ImageType.Image);
                    drawX += size.Width + 5;
                }

                size = Library.GetSize(index);

                for (int i = 0; i < text.Length; i++)
                {
                    int number;

                    if (!int.TryParse(text[i].ToString(), out number))
                    {
                        if (text[i] == '+')
                        {
                            number = 10;
                        }
                        else if (text[i] == '-')
                        {
                            number = 11;
                        }
                        else
                        {
                            continue;
                        }
                    }


                    Library.Draw(index, drawX, drawY, Color.White, new Rectangle(width * number, 0, Math.Min(size.Width - width * number, width), size.Height), Opacity, ImageType.Image);
                    drawX += width;
                }
            }
        }