Пример #1
0
        private Rect DrawButton(Rect rect, Status status, TranslationDictionary translationDictionary, string translationKey, SerializedProperty dictionary)
        {
            if (IsButtonDrawn(status) == true)
            {
                // Adjust height
                rect.y     += EditorHelpers.VerticalMargin + rect.height;
                rect.height = ButtonHeight;

                // Add indentation
                rect.x     += IndentLeft;
                rect.width -= IndentLeft;

                // Draw buttons
                if ((status == Status.DictionaryNotSet) && (GUI.Button(rect, "Create New Dictionary") == true))
                {
                    // Add the key into the translations dictionary
                    dictionary.objectReferenceValue = TranslationDictionaryEditor.CreateTranslationDictionary();
                }
                else if ((status == Status.UnknownKey) && (GUI.Button(rect, "Create New Key") == true))
                {
                    // Add the key into the translations dictionary
                    translationDictionary.AllTranslations.Add(translationKey);
                    translationDictionary.UpdateSerializedTranslations();
                }
                else if (status == Status.OK)
                {
                    DrawDictionaryButton(rect, dictionary, translationDictionary);
                }

                // Remove indentation
                rect.x     -= IndentLeft;
                rect.width += IndentLeft;
            }
            return(rect);
        }
        public static void ShowPopUp(TranslationDictionaryEditor editor)
        {
            UpdateFontAssets window = GetWindow <UpdateFontAssets>(true, "Update Font Assets", true);

            window.Editor           = editor;
            window.DictionaryToEdit = (TranslationDictionary)editor.serializedObject.targetObject;
            window.Setup();
            window.Show();
        }
Пример #3
0
        public static void ShowPopUp(TranslationDictionaryEditor editor)
        {
            ImportCsvPopUp window = GetWindow <ImportCsvPopUp>(true, "Import CSV", true);

            window.Editor           = editor;
            window.DictionaryToEdit = (TranslationDictionary)editor.serializedObject.targetObject;
            window.minSize          = DefaultWindowSize;
            window.Show();
        }