Example #1
0
 private string CodeToString(ChipFolder.CODE code)
 {
     if (code == ChipFolder.CODE.asterisk)
     {
         return("*");
     }
     else if (code == ChipFolder.CODE.none)
     {
         return(string.Empty);
     }
     else
     {
         return(code.ToString());
     }
 }
Example #2
0
        public override void Render(IRenderer dg)
        {
            if (this.shopmode)
            {
                this._position = new Vector2(0.0f, 0.0f);
                this._rect     = new Rectangle(480, 304, 240, 160);
                dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                Vector2 vector2;
                if (!this.help || !this.right)
                {
                    for (int index = 0; index < this.savedata.haveCaptureBomb; ++index)
                    {
                        this._position = new Vector2(0.0f, 24 + 32 * index);
                        this._rect     = new Rectangle(840, 640, 120, 32);
                        dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                        if (this.savedata.HaveVirus[index] != null)
                        {
                            AllBase.NAME[] nameArray = this.Nametodata(this.savedata.HaveVirus[index].Name);
                            vector2        = new Vector2(8f, 32 + index * 32);
                            this._position = new Vector2(vector2.X, vector2.Y);
                            DrawBlockCharacters(dg, nameArray, 88, this._position, Color.White, out this._rect, out this._position);
                            this._position = new Vector2(88f, 32 + 32 * index);
                            this._rect     = new Rectangle(this.savedata.HaveVirus[index].code * 8, 120, 8, 16);
                            dg.DrawImage(dg, "font", this._rect, true, this._position, Color.White);
                        }
                        else
                        {
                            var            emptyText = ShanghaiEXE.Translate("Virus.Empty");
                            AllBase.NAME[] nameArray = this.Nametodata(emptyText);
                            vector2        = new Vector2(8f, 32 + index * 32);
                            this._position = new Vector2(vector2.X, vector2.Y);
                            DrawBlockCharacters(dg, nameArray, 16, this._position, Color.White, out this._rect, out this._position);
                        }
                    }
                    this._position = new Vector2(8f, 120f);
                    this._rect     = new Rectangle(720, 672, 104, 40);
                    dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                }
                if (!this.help || this.right)
                {
                    if (this.top > 0)
                    {
                        this._position = new Vector2(120f, -8f);
                        this._rect     = new Rectangle(720, 640, 120, 32);
                        dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                    }
                    for (int index = 0; index < 6; ++index)
                    {
                        int num = index;
                        if (this.top + num < this.savedata.stockVirus.Count && this.savedata.stockVirus[num + this.top] != null)
                        {
                            this._position = new Vector2(120f, 24 + 32 * num);
                            this._rect     = new Rectangle(720, 640, 120, 32);
                            dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                            AllBase.NAME[] nameArray = this.Nametodata(this.savedata.stockVirus[num + this.top].Name);
                            vector2        = new Vector2(128f, 32 + num * 32);
                            this._position = new Vector2(vector2.X, vector2.Y);
                            DrawBlockCharacters(dg, nameArray, 88, this._position, Color.White, out this._rect, out this._position);
                            this._position = new Vector2(208f, 32 + 32 * num);
                            this._rect     = new Rectangle(this.savedata.stockVirus[num + this.top].code * 8, 120, 8, 16);
                            dg.DrawImage(dg, "font", this._rect, true, this._position, Color.White);
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                if (this.help)
                {
                    int   num1 = 56;
                    Virus virus;
                    int   num2;
                    if (this.right)
                    {
                        virus = this.savedata.stockVirus[this.Select];
                        num2  = 4;
                    }
                    else
                    {
                        virus = this.savedata.HaveVirus[this.cursol];
                        num2  = 124;
                    }
                    if (virus != null)
                    {
                        this._position = new Vector2(num2 + 56, 48f);
                        virus.Render(dg, this._position, true);
                        this._rect     = new Rectangle(568, 128, 112, 88);
                        this._position = new Vector2(num2, 16 + num1);
                        dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                        ChipFolder.CODE code = (ChipFolder.CODE)virus.code;
                        string          txt1 = virus.Name + " " + code.ToString();
                        this._position = new Vector2(num2 + 8, 20 + num1);
                        this.TextRender(dg, txt1, false, this._position, false);
                        this._rect     = new Rectangle(232, 0, 24, 16);
                        this._position = new Vector2(num2 + 16, 44 + num1);
                        dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                        int    num3 = 100 + virus.eatBug * 5;
                        string txt2 = (num3 / 100).ToString() + "." + (num3 % 100 < 10 ? "0" : "") + (num3 % 100).ToString();
                        this._position = new Vector2(num2 + 48, 44 + num1);
                        this.TextRender(dg, txt2, false, this._position, true, Color.Yellow);
                        this._position = new Vector2(num2 + 16, 60 + num1);
                        this.TextRender(dg, ShanghaiEXE.Translate("VirusManager.HP"), false, this._position, true);
                        this._position = new Vector2(num2 + 72, 60 + num1);
                        int    num4 = virus.HP;
                        string txt3 = num4.ToString();
                        this.TextRender(dg, txt3, true, this._position, true, Color.Yellow);
                        this._position = new Vector2(num2 + 16, 76 + num1);
                        this.TextRender(dg, ShanghaiEXE.Translate("VirusManager.Power"), false, this._position, true);
                        this._position = new Vector2(num2 + 72, 76 + num1);
                        num4           = virus.Power;
                        string txt4 = num4.ToString();
                        this.TextRender(dg, txt4, true, this._position, true, Color.Yellow);
                        this._rect     = new Rectangle(320, 0, 16, 48);
                        this._position = new Vector2(num2 + 88, 44 + num1);
                        dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                    }
                    else
                    {
                        this._position = new Vector2(num2, 52 + num1);
                        string txt = "EMPTY";
                        this.TextRender(dg, txt, false, this._position, true);
                    }
                }
                this._rect     = new Rectangle(240 + 16 * this.cursolanime, 48, 16, 16);
                this._position = new Vector2(!this.right ? -8f : 112f, 32 + 32 * this.cursol);
                dg.DrawImage(dg, "window", this._rect, true, this._position, Color.White);
                if (this.selected && this.cursolanime2)
                {
                    if (!this.selectedForB)
                    {
                        if (!this.help || !this.right)
                        {
                            int cursolanime = this.cursolanime;
                            this._rect     = new Rectangle(240 + 0, 48, 16, 16);
                            this._position = new Vector2(-8f, 32 + this.selectedCursol * 32);
                            dg.DrawImage(dg, "window", this._rect, true, this._position, Color.White);
                        }
                    }
                    else if ((!this.help || this.right) && (this.selectedCursol - this.top >= 0 && this.selectedCursol - this.top < 4))
                    {
                        int cursolanime = this.cursolanime;
                        this._rect     = new Rectangle(240 + 0, 48, 16, 16);
                        this._position = new Vector2(112f, 32 + (this.selectedCursol - this.top) * 32);
                        dg.DrawImage(dg, "window", this._rect, true, this._position, Color.White);
                    }
                }
                this._position = new Vector2(0.0f, 0.0f);
                this._rect     = new Rectangle(720, 624, 240, 16);
                dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
            }
            if (this.eventmanager.playevent)
            {
                this.eventmanager.Render(dg);
            }
            if (this.alpha <= 0)
            {
                return;
            }
            Color     color  = Color.FromArgb(alpha, Color.Black);
            Rectangle _rect  = new Rectangle(0, 0, 240, 160);
            Vector2   _point = new Vector2(0.0f, 0.0f);

            dg.DrawImage(dg, "fadescreen", _rect, true, _point, color);
        }