Example #1
0
        public static CreateLanguageWindow ShowWindow(SmartLocalizationWindow parentWindow)
        {
            CreateLanguageWindow thisWindow = (CreateLanguageWindow)EditorWindow.GetWindow <CreateLanguageWindow>("Новый язык");    //New Language

            thisWindow.parentWindow = parentWindow;
            return(thisWindow);
        }
Example #2
0
        /// <summary> Shows the translate window window. </summary>
        public static TranslateLanguageWindow ShowWindow(SmartCultureInfo info, SmartLocalizationWindow smartLocWindow)
        {
            TranslateLanguageWindow translateLanguageWindow = (TranslateLanguageWindow)EditorWindow.GetWindow <TranslateLanguageWindow>("Перевод языка", true, typeof(SmartLocalizationWindow));    // Translate Language

            translateLanguageWindow.Initialize(info);
            return(translateLanguageWindow);
        }
Example #3
0
        public static LanguageUpdateWindow ShowWindow(SmartCultureInfo info, SmartLocalizationWindow parentWindow)
        {
            LanguageUpdateWindow languageUpdateWindow = (LanguageUpdateWindow)EditorWindow.GetWindow <LanguageUpdateWindow>("Обновить");      //Update

            languageUpdateWindow.Initialize(info, parentWindow);

            return(languageUpdateWindow);
        }
Example #4
0
        public static BulkUpdateWindow ShowWindow(BulkUpdateMethod updateMethod, SmartLocalizationWindow parentWindow)
        {
            BulkUpdateWindow thisWindow = (BulkUpdateWindow)EditorWindow.GetWindow <BulkUpdateWindow>("Обновить языки");    //Update Languages

            thisWindow.Initialize(updateMethod, parentWindow);

            return(thisWindow);
        }
Example #5
0
        void Initialize(SmartCultureInfo chosenCulture, SmartLocalizationWindow parentWindow)
        {
            this.chosenCulture = chosenCulture;
            this.parentWindow  = parentWindow;

            if (chosenFileFormat >= availableFileFormats.Length)
            {
                chosenFileFormat = 0;
            }
        }
Example #6
0
        /// <summary>
        /// Call this from OnInspectorGUI in your own editor class. It will create buttons and a selectable popup with all the keys available.
        /// </summary>
        /// <param name="currentKey">The currently chosen key</param>
        /// <param name="sort">If the select key GUI should filter keys with a certain type</param>
        /// <param name="sortType">If sort is true, this is the type of keys that will be shown.</param>
        /// <returns>The currently chosen key</returns>
        public static string SelectKeyGUI(string currentKey, bool sort = false, LocalizedObjectType sortType = LocalizedObjectType.INVALID)
        {
            if (!ShouldShowKeySelector())
            {
                return(currentKey);
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("GGLocalization", EditorStyles.boldLabel);
            if (GUILayout.Button("Открыть", GUILayout.Width(70)))
            {
                SmartLocalizationWindow.ShowWindow();
            }
            EditorGUILayout.EndHorizontal();

            if (autoRefresh || parsedRootValues.Count == 0 || sortType != loadedObjectType)
            {
                RefreshList(sort, sortType);
            }

            EditorGUILayout.BeginHorizontal();
            //GUILayout.Label("Режим сортировки: ", EditorStyles.miniLabel, GUILayout.Width(100));
            if (sort)
            {
                GUILayout.Label("Режим сортировки: " + sortType.ToString() + " только.", EditorStyles.miniLabel);
            }
            else
            {
                GUILayout.Label("Режим сортировки: Показаны ВСЕ типы", EditorStyles.miniLabel);
            }
            EditorGUILayout.EndHorizontal();


            int index = parsedRootValues.IndexOf(currentKey);

            index = Mathf.Max(0, index);
            int newIndex = index;

            newIndex = EditorGUILayout.Popup(index, parsedRootValues.ToArray());

            if (newIndex != index)
            {
                currentKey = parsedRootValues[newIndex];
            }

            if (!autoRefresh && GUILayout.Button("Обновить список", GUILayout.Width(130)))
            {
                RefreshList(sort, sortType);
            }


            return(currentKey);
        }
Example #7
0
 public void Initialize(BulkUpdateMethod updateMethod, SmartLocalizationWindow parentWindow)
 {
     this.updateMedhod = updateMethod;
     this.parentWindow = parentWindow;
 }