Beispiel #1
0
        void OnGUI()
        {
            if (localizedObjectContextMenu == null ||
                localizedObjectAdaptor == null ||
                settingsContextMenu == null ||
                settingsAdaptor == null)
            {
                Initialize();
            }


            if (LocalizationWindowUtility.ShouldShowWindow())
            {
                ReorderableListGUI.Title("Изменить корневые значения");
                EditorGUILayout.Space();

                settingsContextMenu.Draw(settingsAdaptor);

                bool shouldRepaint = listColumns.DrawColumns();
                scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
                localizedObjectContextMenu.Draw(localizedObjectAdaptor);
                EditorGUILayout.EndScrollView();

                if (guiChanged)
                {
                    GUILayout.Label("- Есть несохраненные изменения", EditorStyles.miniLabel);
                }

                //If any changes to the gui is made
                if (GUI.changed)
                {
                    guiChanged = true;
                }

                GUILayout.Label("Сохранить изменения", EditorStyles.boldLabel);
                GUILayout.Label("Не забывайте всегда нажимать сохранить, когда вы изменили значения", EditorStyles.miniLabel);
                if (GUILayout.Button("Сохранить файл корневого языка"))
                {
                    SaveRootLanguageFile();
                    guiChanged = false;
                    GUIUtility.keyboardControl = 0;
                }

                if (shouldRepaint)
                {
                    Repaint();
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Draws the settings window and the main translation view where all the keys are.
        /// </summary>
        void DrawMainTranslationView()
        {
            ReorderableListGUI.Title("Язык - " + thisLanguage);
            EditorGUILayout.Space();

            settingsContextMenu.Draw(settingsAdaptor);

            GUILayout.Label("Языковые значения", EditorStyles.boldLabel);

            bool shouldRepaintColumns = listColumns.DrawColumns();

            if (shouldRepaintColumns)
            {
                shouldRepaint = true;
            }

            scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
            localizedObjectContextMenu.Draw(localizedObjectAdaptor);
            EditorGUILayout.EndScrollView();

            if (guiChanged)
            {
                GUILayout.Label("- У вас есть несохраненные изменения", EditorStyles.miniLabel);
            }

            //If any changes to the gui is made
            if (GUI.changed)
            {
                guiChanged = true;
            }

            GUILayout.Label("Сохранить изменения", EditorStyles.boldLabel);
            GUILayout.Label("Не забывайте всегда нажимать сохранить, когда вы изменили значения", EditorStyles.miniLabel);
            if (GUILayout.Button("Сохранить/Восстановить"))
            {
                SaveAndRebuild();
            }

            if (shouldRepaint)
            {
                Repaint();
                shouldRepaint = false;
            }
        }