/* Yarn Spinner is licensed to you under the terms found in the file LICENSE.md. */ using UnityEditor; using UnityEditor.UIElements; using UnityEngine; using UnityEngine.UIElements; #nullable enable namespace Yarn.Unity.Editor { public class LocalizationEntryElement : VisualElement, INotifyValueChanged { private readonly Foldout foldout; private readonly ObjectField assetFolderField; private readonly ObjectField stringsFileField; private readonly Button deleteButton; private readonly VisualElement stringsFileNotUsedLabel; private readonly LanguageField languagePopup; private readonly Toggle isExternalAssetToggle; private readonly ObjectField externalLocalisationAssetField; private readonly VisualElement externalReferenceFields; private readonly VisualElement internallyGeneratedAssetFields; public event System.Action? OnDelete; ProjectImportData.LocalizationEntry data; public bool IsModified { get; private set; } private string _projectBaseLanguage; public string ProjectBaseLanguage { get => _projectBaseLanguage; set { _projectBaseLanguage = value; SetValueWithoutNotify(this.data); } } public LocalizationEntryElement(VisualTreeAsset asset, ProjectImportData.LocalizationEntry data, string baseLanguage) { asset.CloneTree(this); foldout = this.Q("foldout"); assetFolderField = this.Q("assetFolder"); stringsFileField = this.Q("stringsFile"); deleteButton = this.Q