public TranslationCollectionEditor(Editor editor, SerializedProperty element, SupportedLanguages supportedLanguages)
        {
            // Setup member variables
            this.editor             = editor;
            Element                 = element;
            this.supportedLanguages = supportedLanguages;

            // Setup the bools
            EditorHelpers.CreateBool(editor, ref showHelpBox);
            EditorHelpers.CreateBool(editor, ref showAllTranslationsList);
        }
        public LanguageTextPairEditor(Editor editor, SerializedProperty element, SupportedLanguages supportedLanguages)
        {
            // Setup member variables
            this.editor             = editor;
            this.SupportedLanguages = supportedLanguages;
            Element = element;

            // Setup the bools
            EditorHelpers.CreateBool(editor, ref showHelpBox);
            EditorHelpers.CreateBool(editor, ref expandToggle);
        }
Beispiel #3
0
        private void OnEnable()
        {
            // Serialized properties and graphical wrappers
            supportedLanguages                     = serializedObject.FindProperty("supportedLanguages");
            defaultToWhenKeyNotFound               = serializedObject.FindProperty("defaultToWhenKeyNotFound");
            presetMessageWhenKeyNotFound           = serializedObject.FindProperty("presetMessageWhenKeyNotFound");
            defaultToWhenTranslationNotFound       = serializedObject.FindProperty("defaultToWhenTranslationNotFound");
            presetMessageWhenTranslationNotFound   = serializedObject.FindProperty("presetMessageWhenTranslationNotFound");
            defaultLanguageWhenTranslationNotFound = serializedObject.FindProperty("defaultLanguageWhenTranslationNotFound");
            replaceEmptyStringWithDefaultText      = serializedObject.FindProperty("replaceEmptyStringWithDefaultText");

            // Setup animations
            EditorHelpers.CreateBool(this, ref showErrorMessage);
            EditorHelpers.CreateBool(this, ref showDefaultConfigurations);
            EditorHelpers.CreateBool(this, ref showPresetMessageForKeyNotFound);
            EditorHelpers.CreateBool(this, ref showDefaultLanguageForTranslationNotFound);
            EditorHelpers.CreateBool(this, ref showPresetMessageForTranslationNotFound);

            // Setup transations list
            translations     = serializedObject.FindProperty("translations");
            translationsList = new ReorderableList(serializedObject, translations, true, true, true, true);
            translationsList.drawHeaderCallback           = DrawTranslationsListHeader;
            translationsList.drawElementCallback          = DrawTranslationsListElement;
            translationsList.elementHeightCallback        = CalculateTranslationsListElementHeight;
            translationsList.onAddCallback                = OnAddTranslation;
            translationsList.onRemoveCallback             = OnRemoveTranslation;
            translationsList.onReorderCallbackWithDetails = OnReorderTranslationList;

            // Populate the status list
            translationStatus.Clear();
            frequencyInKeyAppearance.Clear();
            for (int index = 0; index < translationsList.count; ++index)
            {
                AddEntryFromTranslationListStatus(translationsList, index);
            }
            UpdateTranslationListStatus(translationsList, 0);

            // Setup search field
            //searchField = new SearchField();
            recalculateSearchResult = true;
        }