Exemplo n.º 1
0
        static void ProcessCommandLineArguments(string[] args)
        {
            //VerifyScnRegistry();
            bool replace = true;

            foreach (string s in args)
            {
                if (FileManager.GetExtension(s) == "scn")
                {
                    GuiData.MenuStrip.PerformLoadScn(s, replace);
                    FlatRedBall.Gui.FileWindow.SetLastDirectory("scn", FileManager.GetDirectory(s));
                    FlatRedBall.Gui.FileWindow.SetLastDirectory("bmp", FileManager.GetDirectory(s));
                    FlatRedBall.Gui.FileWindow.SetLastDirectory("srgx", FileManager.GetDirectory(s));
                    replace = false;
                }
                else if (FileManager.GetExtension(s) == "scnx")
                {
                    GuiData.MenuStrip.PerformLoadScn(s, replace);
                    FlatRedBall.Gui.FileWindow.SetLastDirectory("scn", FileManager.GetDirectory(s));
                    FlatRedBall.Gui.FileWindow.SetLastDirectory("scnx", FileManager.GetDirectory(s));
                    FlatRedBall.Gui.FileWindow.SetLastDirectory("bmp", FileManager.GetDirectory(s));
                    FlatRedBall.Gui.FileWindow.SetLastDirectory("srgx", FileManager.GetDirectory(s));

                    replace = false;
                }
            }
        }
Exemplo n.º 2
0
        private void GameForm_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                // Assign the file names to a string array, in
                // case the user has selected multiple files.
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                try
                {
                    System.Drawing.Point p = this.PointToClient(new Point(e.X, e.Y));


                    foreach (string fileName in files)
                    {
                        string extension = FileManager.GetExtension(fileName);

                        switch (extension)
                        {
                        case "bmp":
                        case "jpg":
                        case "tga":
                        case "png":
                        case "dds":
                            GameData.AddSprite(fileName, "");
                            this.BringToFront();
                            this.Focus();

                            break;

                        case "scnx":
                            GuiData.MenuStrip.AskToReplaceOrInsertNewScene(fileName);
                            break;

                        case "x":
                            GameData.AddModel(fileName);
                            break;
                        }
                    }
                }
                catch (Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message);
                    return;
                }
            }
        }