示例#1
0
        public LevelCharacter(Form1 form)
        {
            InitializeComponent();
            this.form  = form;
            p          = new PictureBox();
            p.Location = new Point(0, 0);
            p.Size     = new Size(7500, 520);
            this.Controls.Add(p);
            if (form.full == true)
            {
                this.Location = new Point(this.Location.X, this.Location.Y - 20);
            }
            Config config = OptionPlay.ReadConfig();

            for (int i = 0; i < 15; i++)
            {
                character[i]          = new PictureBox();
                character[i].Location = new Point(i * 500, 20);
                character[i].Size     = new Size(500, 500);
                character[i].SizeMode = PictureBoxSizeMode.Zoom;
                p.Controls.Add(character [i]);
                character[i].BackColor = Color.Transparent;
                character[i].Paint    += new PaintEventHandler(Character_Paint);
                character[i].Name      = Information.StringLevel + " " + (i + 1).ToString();
            }
            for (int i = 1; i <= config.MaxLevel; i++)
            {
                String Filename = Information.directories + "\\Collection\\";
                Filename += "Level" + (i).ToString() + ".UIT";
                if (File.Exists(Filename))
                {
                    try
                    {
                        ImageFile imagefile = ReadfileImage.ReadFile(Filename);
                        if (imagefile.ImageLevel != null && imagefile.level == i)
                        {
                            character[i - 1].Image = imagefile.ImageLevel;
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
            p.BackColor   = Color.Transparent;
            time.Interval = 30;
            time.Tick    += new EventHandler(time_Tick);
            this.TopMost  = true;
            tmp           = 0;
            button1.Text  = Information.StringButtonCancel;
            label1.Text   = Information.StringCollectionPikemon;
        }
示例#2
0
        private void InitialImage()
        {
            String Filename = Information.directories + "\\Collection\\";

            Filename += "Level" + Level.ToString() + ".UIT";
            //NextLevel.Show();
            //LevelFile.WriteFile(Filename);
            if (File.Exists(Filename))
            {
                try
                {
                    Information.imageFileLevel = ReadfileImage.ReadFile(Filename);
                    if (Information.imageFileLevel.ImageLevel != null && Information.imageFileLevel.level == Level)
                    {
                        ImageLevel = Information.imageFileLevel.ImageLevel;
                    }
                    else
                    {
                        ImageLevel = global::UIT_Pokemon.Properties.Resources.findbutton;
                    }
                }
                catch
                {
                    Information.imageFileLevel = new ImageFile(null, 1);
                }
                try
                {
                    GC.Collect();
                }
                catch { }
            }
            else
            {
                Information.imageFileLevel = new ImageFile(null, 1);
                ImageLevel = global::UIT_Pokemon.Properties.Resources.findbutton;
            }
            lockBack = true;
            LockGame = false;
            gameover = false;
        }