public void ExportMainGameData()
        {
            if (!HacksAndKludges.AreDialogScriptsCached(editor))
            {
                System.Windows.Forms.MessageBox.Show(
                    "Please build the project properly first.",
                    "Build Required",
                    System.Windows.Forms.MessageBoxButtons.OK,
                    System.Windows.Forms.MessageBoxIcon.Warning);
                return;
            }
            ExportProgress progressDialog = new ExportProgress();
            progressDialog.ExportBackgroundWorker.DoWork +=
                delegate(object sender, DoWorkEventArgs e)
                {
                    BackgroundWorker worker = (BackgroundWorker)sender;

                    TaskManager.Expect(TASK_EXPORT_MAIN_GAME_DATA);

                    using (TaskManager exportTask = TaskManager.Start(TASK_EXPORT_MAIN_GAME_DATA))
                    {
                        progressDialog.SetTaskManager(exportTask);

                        TaskManager.Expect(TASK_PREPARE_BITMAP_EXPORT);
                        TaskManager.Expect(TASK_EXPORT_GLOBAL_SCRIPTS);
                        TaskManager.Expect(TASK_PREPARE_IMAGE_SHEETS);
                        TaskManager.Expect(TASK_EXPORT_GAME_DEF);
                        TaskManager.Expect(TASK_EXPORT_ICONS);
                        TaskManager.Expect(TASK_EXPORT_GAME_IMAGE_SHEETS);
                        TaskManager.Expect(TASK_EXPORT_TRANSLATIONS);
                        TaskManager.Expect(TASK_POSTPROCESS_BITMAPS);

                        using (TaskManager.Start(TASK_PREPARE_BITMAP_EXPORT))
                        {
                            PrepareBitmapExport();
                        }
                        using (TaskManager.Start(TASK_PREPARE_IMAGE_SHEETS))
                        {
                            PrepareGameImageSheets();
                        }
                        using (TaskManager.Start(TASK_EXPORT_GAME_DEF))
                        {
                            ExportGameDef();
                        }
                        using (TaskManager.Start(TASK_EXPORT_GLOBAL_SCRIPTS))
                        {
                            ExportGlobalScripts();
                        }
                        using (TaskManager.Start(TASK_EXPORT_ICONS, true))
                        {
                            ExportIcons();
                        }
                        using (TaskManager.Start(TASK_EXPORT_GAME_IMAGE_SHEETS, true))
                        {
                            ExportGameImageSheets();
                        }
                        using (TaskManager.Start(TASK_EXPORT_TRANSLATIONS))
                        {
                            foreach (AGS.Types.Translation translation in editor.CurrentGame.Translations)
                            {
                                ExportTranslation(translation);
                            }
                        }
                        using (TaskManager.Start(TASK_POSTPROCESS_BITMAPS))
                        {
                            PostProcessBitmaps();
                        }
                    }
                };
            progressDialog.ShowDialog(HacksAndKludges.GetMainWindow());
        }
        public void ExportCurrentRoomData()
        {
            if (!HacksAndKludges.AreDialogScriptsCached(editor))
            {
                System.Windows.Forms.MessageBox.Show(
                    "Please build the project properly first.",
                    "Build Required",
                    System.Windows.Forms.MessageBoxButtons.OK,
                    System.Windows.Forms.MessageBoxIcon.Warning);
                return;
            }
            ExportProgress progressDialog = new ExportProgress();
            progressDialog.ExportBackgroundWorker.DoWork +=
                delegate(object sender, DoWorkEventArgs e)
                {
                    BackgroundWorker worker = (BackgroundWorker)sender;

                    TaskManager.Expect(TASK_EXPORT_CURRENT_ROOM_DATA);

                    using (TaskManager exportTask = TaskManager.Start(TASK_EXPORT_CURRENT_ROOM_DATA))
                    {
                        progressDialog.SetTaskManager(exportTask);

                        TaskManager.Expect(TASK_PREPARE_BITMAP_EXPORT);
                        TaskManager.Expect(TASK_EXPORT_ROOM_DEF);
                        TaskManager.Expect(TASK_EXPORT_ROOM_SCRIPT);
                        TaskManager.Expect(TASK_EXPORT_ROOM_BACKGROUNDS);
                        TaskManager.Expect(TASK_POSTPROCESS_BITMAPS);

                        using (TaskManager.Start(TASK_PREPARE_BITMAP_EXPORT))
                        {
                            PrepareBitmapExport();
                        }
                        using (TaskManager.Start(TASK_EXPORT_ROOM_DEF))
                        {
                            ExportCurrentRoomDef();
                        }
                        using (TaskManager.Start(TASK_EXPORT_ROOM_SCRIPT))
                        {
                            ExportCurrentRoomScript();
                        }
                        using (TaskManager.Start(TASK_EXPORT_ROOM_BACKGROUNDS))
                        {
                            ExportCurrentRoomBackgrounds();
                        }
                        using (TaskManager.Start(TASK_POSTPROCESS_BITMAPS))
                        {
                            PostProcessBitmaps();
                        }
                    }

                };
            progressDialog.ShowDialog(HacksAndKludges.GetMainWindow());
        }