Beispiel #1
0
        private void ShowProjectScriptPresenterDlg(Func <ProjectExporter, Form> getProjectScriptPresenterDlg)
        {
            EnsureGroupsAreInSynchWithCharactersInUse();

            var model = new ProjectSettingsViewModel(m_project);

            while (m_project.ReferenceText == null)
            {
                string msg;
                using (var dlg = new ProjectSettingsDlg(model))
                {
                    var msgFmt = LocalizationManager.GetString("Project.UnavailableReferenceText",
                                                               "This project uses the {0} reference text, which is no longer available. " +
                                                               "If possible, put the required reference text files in" +
                                                               "\r\n   {1}\r\n" +
                                                               "and then click Retry to use the {0} reference text.\r\n" +
                                                               "Otherwise, to continue and temporarily use the English reference text, click Ignore.\r\n" +
                                                               "Note: to permanently change the reference text used by this project, open the {2} " +
                                                               "dialog box and select the desired reference text on the {3} tab page.");
                    msg = String.Format(msgFmt, m_project.UiReferenceTextName,
                                        m_project.ReferenceTextIdentifier.ProjectFolder,
                                        dlg.Text, dlg.ReferenceTextTabPageName);
                }
                switch (MessageBox.Show(msg, Program.kProduct, MessageBoxButtons.AbortRetryIgnore))
                {
                case DialogResult.Abort: return;

                case DialogResult.Ignore:
                    m_project.ReferenceText = ReferenceText.GetStandardReferenceText(ReferenceTextType.English);
                    break;
                }
            }

            var exporter = new ProjectExporter(m_project);

            if (!IsOkToExport(exporter))
            {
                return;
            }

            using (var dlg = getProjectScriptPresenterDlg(exporter))
            {
                ShowModalDialogWithWaitCursor(dlg);
                ShowLastLocation();
            }
        }
Beispiel #2
0
        private void Export_Click(object sender, EventArgs e)
        {
            EnsureGroupsAreInSynchWithCharactersInUse();

            var exporter = new ProjectExporter(m_project);

            bool export = true;

            if (exporter.IncludeVoiceActors)
            {
                string dlgMessage = null;
                string dlgTitle   = null;
                if (!m_project.IsVoiceActorAssignmentsComplete)
                {
                    dlgMessage = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.NotAssignedMessage",
                                                               "One or more character groups have no voice actor assigned. Are you sure you want to export an incomplete script?");
                    dlgTitle = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.TitleIncomplete", "Export Incomplete Script?");
                }
                else if (!m_project.EveryAssignedGroupHasACharacter)
                {
                    dlgMessage = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.EmptyGroupMessage",
                                                               "One or more character groups have no characters in them. Are you sure you want to export a script?");
                    dlgTitle = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.Title", "Export Script?");
                }
                else if (m_project.HasUnusedActor)
                {
                    dlgMessage = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.UnusedActorMessage",
                                                               "One or more voice actors have not been assigned to a character group. Are you sure you want to export a script?");
                    dlgTitle = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.Title", "Export Script?");
                }
                if (dlgMessage != null)
                {
                    dlgMessage += Environment.NewLine +
                                  LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.MessageNote",
                                                                "(Note: You can export the script again as many times as you want.)");
                    export = MessageBox.Show(dlgMessage, dlgTitle, MessageBoxButtons.YesNo) == DialogResult.Yes;
                }
            }
            if (export)
            {
                using (var dlg = new ExportDlg(exporter))
                    dlg.ShowDialog(this);
            }
        }
Beispiel #3
0
        private bool IsOkToExport(ProjectExporter exporter)
        {
            var    export     = true;
            string dlgMessage = null;
            string dlgTitle   = null;

            if (exporter.IncludeVoiceActors)
            {
                if (!m_project.IsVoiceActorAssignmentsComplete)
                {
                    dlgMessage = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.NotAssignedMessage",
                                                               "One or more character groups have no voice actor assigned. Are you sure you want to export an incomplete script?");
                    dlgTitle = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.TitleIncomplete", "Export Incomplete Script?");
                }
                else if (!m_project.EveryAssignedGroupHasACharacter)
                {
                    dlgMessage = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.EmptyGroupMessage",
                                                               "One or more character groups have no characters in them. Are you sure you want to export a script?");
                    dlgTitle = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.Title", "Export Script?");
                }
            }
            else if (m_project.ProjectAnalysis.UserPercentAssigned < 100d)
            {
                dlgMessage = string.Format(LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.CharacterAssignmentIncompleteMessage",
                                                                         "Character assignment is {0:N1}% complete. Are you sure you want to export a script?"), m_project.ProjectAnalysis.UserPercentAssigned);
                dlgTitle = LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.TitleIncomplete", "Export Incomplete Script?");
            }

            if (dlgMessage != null)
            {
                dlgMessage += Environment.NewLine +
                              LocalizationManager.GetString("DialogBoxes.ExportIncompleteScript.MessageNote",
                                                            "(Note: You can export the script again as many times as you want.)");
                export = MessageBox.Show(dlgMessage, dlgTitle, MessageBoxButtons.YesNo) == DialogResult.Yes;
            }

            return(export);
        }