Exemplo n.º 1
0
        public List <TranslationManager.TranslationDialogue> searchText(string text, List <TranslationManager.TranslationDialogue> source)
        {
            List <TranslationManager.TranslationDialogue> translationDialogues = new List <TranslationManager.TranslationDialogue>();

Label0:
            foreach (TranslationManager.TranslationDialogue translationDialogue in source)
            {
                bool flag = false;
Label1:
                foreach (TranslationManager.TranslationDialogueLine line in translationDialogue.Lines)
                {
                    if (!flag)
                    {
                        foreach (TranslationManager.TranslationDialogueLine.Line line1 in line.Lines)
                        {
                            if (!NavigationTranslation.contains(text, line1.Translation) && !NavigationTranslation.contains(text, line1.Original))
                            {
                                continue;
                            }
                            translationDialogues.Add(translationDialogue);
                            flag = true;
                            goto Label1;
                        }
                    }
                    else
                    {
                        goto Label0;
                    }
                }
            }
            return(translationDialogues);
        }
Exemplo n.º 2
0
 public TranslationDialog(navigation nav, NavigationTranslation navTranslation)
 {
     this.nav            = nav;
     this.navTranslation = navTranslation;
     this.InitializeComponent();
     base.CenterToScreen();
     this.Calculate();
 }
Exemplo n.º 3
0
        private bool findLine(string pattern, TreeNodeCollection nodes)
        {
            bool        flag;
            IEnumerator enumerator = nodes.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    TreeNode current = (TreeNode)enumerator.Current;
                    DialogTranslation.LineData tag = current.Tag as DialogTranslation.LineData;
                    List <TranslationManager.TranslationDialogueLine.Line> .Enumerator enumerator1 = tag.dialogueLine.Lines.GetEnumerator();
                    try
                    {
                        while (enumerator1.MoveNext())
                        {
                            TranslationManager.TranslationDialogueLine.Line line = enumerator1.Current;
                            if (!NavigationTranslation.contains(pattern, line.Original) && !NavigationTranslation.contains(pattern, line.Translation))
                            {
                                continue;
                            }
                            this.tvDialog.SelectedNode = current;
                            flag = true;
                            return(flag);
                        }
                    }
                    finally
                    {
                        ((IDisposable)enumerator1).Dispose();
                    }
                    if (tag.isLink || !this.findLine(pattern, current.Nodes))
                    {
                        continue;
                    }
                    flag = true;
                    return(flag);
                }
                return(false);
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            return(flag);
        }
Exemplo n.º 4
0
 public DialogTranslation(NavigationTranslation nt, navigation nav, TranslationManager.TranslationDialogue item)
 {
     this.InitializeComponent();
     this.nav                    = nav;
     this.navTranslation         = nt;
     this.gameData               = nav.ou.gameData;
     this.dialogueItem           = item.Item;
     this.item                   = item;
     this.txtDialogName.Text     = this.dialogueItem.Name;
     this.txtDialogName.ReadOnly = item.Item.getState() != GameData.State.OWNED;
     this.referenceList1.Exclusions.Add("lines");
     this.referenceList1.Exclusions.Add("conditions");
     this.referenceList1.Exclusions.Add("effects");
     this.referenceList1.setup(null, nav);
     this.createConversationTree(this.dialogueItem, this.tvDialog.Nodes);
 }
Exemplo n.º 5
0
        public void UpdateList(string filter = "")
        {
            this.contentFilter = null;
            List <TranslationManager.TranslationDialogue> translationDialogues  = null;
            List <TranslationManager.TranslationDialogue> translationDialogues1 = ((itemType)this.treeCategories.SelectedNode.Tag == itemType.DIALOGUE ? TranslationManager.EnabledDialogues : TranslationManager.EnabledWordSwaps);

            if (string.IsNullOrWhiteSpace(filter))
            {
                translationDialogues = translationDialogues1;
            }
            else if (!filter.StartsWith("text:", true, CultureInfo.InvariantCulture))
            {
                translationDialogues = translationDialogues1.FindAll((TranslationManager.TranslationDialogue i) => {
                    if (NavigationTranslation.contains(filter, i.Item.Name))
                    {
                        return(true);
                    }
                    return(NavigationTranslation.contains(filter, i.Item.stringID));
                });
            }
            else
            {
                this.contentFilter   = filter.Substring(5).Trim();
                translationDialogues = this.searchText(this.contentFilter, translationDialogues1);
            }
            if (!this.filterTranslated.Checked)
            {
                translationDialogues = translationDialogues.FindAll((TranslationManager.TranslationDialogue i) => i.State != TranslationManager.DialogueTranslationState.OK);
            }
            if (!this.filterUntranslated.Checked)
            {
                translationDialogues = translationDialogues.FindAll((TranslationManager.TranslationDialogue i) => i.State != TranslationManager.DialogueTranslationState.NEW);
            }
            if (!this.filterUpdated.Checked)
            {
                translationDialogues = translationDialogues.FindAll((TranslationManager.TranslationDialogue i) => i.State != TranslationManager.DialogueTranslationState.ORIGINAL_MODIFIED);
            }
            this.listItems.BeginUpdate();
            this.listItems.Items.Clear();
            foreach (TranslationManager.TranslationDialogue translationDialogue in translationDialogues)
            {
                this.listItems.Items.Add(translationDialogue);
            }
            this.listItems.EndUpdate();
        }