Exemplo n.º 1
0
        private void tsmiFileNewASPK_Click(object sender, EventArgs e)
        {
            frmAlphaSpritePackBrowser frm = new frmAlphaSpritePackBrowser("New ASPK");

            frm.MdiParent = this;

            WindowManager.aspkWindows.Add(frm);

            frm.Show();
        }
Exemplo n.º 2
0
        private void OpenSpritePackage(string filename)
        {
            string ext = Path.GetExtension(filename);

            if (ext == ".spk" || ext == ".ispk" || ext == ".sspk" || ext == ".aspk")
            {
                tsStatusLabel.Text = "Loading " + filename + ". Please wait...";
                this.Refresh();

                if (ext == ".spk")
                {
                    CSpritePack spk = CSpritePackHelper.LoadFromFile(filename);

                    if (spk.Initialized)
                    {
                        frmSpritePackBrowser spkbrowser = new frmSpritePackBrowser(spk, filename);

                        WindowManager.spkWindows.Add(spkbrowser);

                        spkbrowser.MdiParent = this;
                        spkbrowser.Show();
                    }
                    else
                    {
                        MessageBox.Show("Invalid Sprite.");

                        return;
                    }
                }

                if (ext == ".ispk")
                {
                    CIndexSpritePack ispk = CIndexSpritePackHelper.LoadFromFile(filename);

                    if (ispk.Initialized)
                    {
                        frmIndexSpritePackBrowser ispkbrowser = new frmIndexSpritePackBrowser(ispk, filename);

                        WindowManager.ispkWindows.Add(ispkbrowser);

                        ispkbrowser.MdiParent = this;
                        ispkbrowser.Show();
                    }
                    else
                    {
                        MessageBox.Show("Invalid Sprite.");

                        return;
                    }
                }

                if (ext == ".sspk")
                {
                    CShadowSpritePack sspk = CShadowSpritePackHelper.LoadFromFile(filename);

                    if (sspk.Initialized)
                    {
                        frmShadowSpritePackBrowser sspkbrowser = new frmShadowSpritePackBrowser(sspk, filename);

                        WindowManager.sspkWindows.Add(sspkbrowser);

                        sspkbrowser.MdiParent = this;
                        sspkbrowser.Show();
                    }
                    else
                    {
                        MessageBox.Show("Invalid Sprite.");

                        return;
                    }
                }

                if (ext == ".aspk")
                {
                    CAlphaSpritePack aspk = CAlphaSpritePackHelper.LoadFromFile(filename);

                    if (aspk.Initialized)
                    {
                        frmAlphaSpritePackBrowser aspkbrowser = new frmAlphaSpritePackBrowser(aspk, filename);

                        WindowManager.aspkWindows.Add(aspkbrowser);

                        aspkbrowser.MdiParent = this;
                        aspkbrowser.Show();
                    }
                    else
                    {
                        MessageBox.Show("Invalid Sprite.");

                        return;
                    }
                }

                tsStatusLabel.Text = "";
            }
        }