// Token: 0x06001379 RID: 4985 RVA: 0x0007C98C File Offset: 0x0007AD8C protected virtual void climbBranch(TranslationBranch newBranch) { this.branch = newBranch; this.treePanel.clearElements(); if (this.branch == null) { TranslationWindow.ETreeMode etreeMode = this.treeMode; string key; if (etreeMode != TranslationWindow.ETreeMode.ORIGIN) { if (etreeMode != TranslationWindow.ETreeMode.TRANSLATION) { Debug.LogError("Unknown translation UI tree mode: " + this.treeMode); return; } key = Translator.language; } else { key = Translator.ORIGIN_LANGUAGE; } Dictionary <string, Translation> dictionary; Translator.languages.TryGetValue(key, out dictionary); foreach (KeyValuePair <string, Translation> keyValuePair in dictionary) { TranslationNamespaceButton translationNamespaceButton = new TranslationNamespaceButton(keyValuePair.Value); translationNamespaceButton.clicked += this.handleNamespaceButtonClicked; this.treePanel.addElement(translationNamespaceButton); } } else { foreach (KeyValuePair <string, TranslationBranch> keyValuePair2 in this.branch.branches) { TranslationBranch value = keyValuePair2.Value; if (value.leaf != null) { TranslationLeafField element = new TranslationLeafField(value.leaf); this.treePanel.addElement(element); } else { TranslationBranchButton translationBranchButton = new TranslationBranchButton(value); translationBranchButton.climbButton.clicked += this.handleBranchClimbButtonClicked; this.treePanel.addElement(translationBranchButton); } } } }
// Token: 0x06001384 RID: 4996 RVA: 0x0007CEE0 File Offset: 0x0007B2E0 protected virtual void handleAddBranchButtonClicked(Sleek2ImageButton button) { if (this.branch == null) { return; } if (this.branch.leaf != null) { return; } if (this.branch.branches == null) { this.branch.addBranches(); } TranslationBranch translationBranch = this.branch.addBranch("new branch"); translationBranch.addBranches(); this.climbBranch(this.branch); }
// Token: 0x0600133A RID: 4922 RVA: 0x0007AB50 File Offset: 0x00078F50 public TranslationBranchButton(TranslationBranch newBranch) { base.name = "Branch"; this.branch = newBranch; this.branch.keyChanged += this.handleKeyChanged; this.climbButton = new Sleek2ImageLabelButton(); this.climbButton.transform.anchorMin = new Vector2(0f, 0f); this.climbButton.transform.anchorMax = new Vector2(0.5f, 1f); this.climbButton.transform.offsetMin = new Vector2(0f, 0f); this.climbButton.transform.offsetMax = new Vector2(0f, 0f); this.addElement(this.climbButton); this.refreshClimbButton(); this.keyField = new Sleek2Field(); this.keyField.transform.anchorMin = new Vector2(0.5f, 0f); this.keyField.transform.anchorMax = new Vector2(1f, 1f); this.keyField.transform.offsetMin = new Vector2(0f, 0f); this.keyField.transform.offsetMax = new Vector2(0f, 0f); this.keyField.text = this.branch.key; this.keyField.submitted += this.handleKeySubmitted; this.addElement(this.keyField); this.layoutComponent = base.gameObject.AddComponent <LayoutElement>(); this.layoutComponent.preferredHeight = (float)Sleek2Config.bodyHeight; }
// Token: 0x0600137C RID: 4988 RVA: 0x0007CC6C File Offset: 0x0007B06C protected virtual void compareTranslationBranches(TranslationBranch origin, TranslationBranch translation) { if (origin == null || translation == null) { return; } if (origin.leaf != null) { if (translation.leaf != null && origin.leaf.version == translation.leaf.version) { return; } if (translation.leaf == null) { translation.addLeaf(); } TranslationLeafUpdateField element = new TranslationLeafUpdateField(origin.leaf, translation.leaf); this.deltaPanel.addElement(element); } else { foreach (KeyValuePair <string, TranslationBranch> keyValuePair in origin.branches) { TranslationBranch value = keyValuePair.Value; TranslationBranch translationBranch; if (!translation.branches.TryGetValue(value.key, out translationBranch)) { translationBranch = translation.addBranch(value.key); } if (translationBranch.branches == null) { translationBranch.addBranches(); } this.compareTranslationBranches(value, translationBranch); } } }
// Token: 0x06001344 RID: 4932 RVA: 0x0007AD8B File Offset: 0x0007918B protected virtual void handleKeyChanged(TranslationBranch branch, string oldKey, string newKey) { this.refreshClimbButton(); }