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

            languageUpdateWindow.Initialize(info, parentWindow);

            return(languageUpdateWindow);
        }
        public SmartCultureInfo DrawAvailableLanguageItem(Rect position, SmartCultureInfo info)
        {
            if (info.englishName != "ROOT")
            {
                float fullWindowWidth = position.width;
                Rect  newPosition     = position;
                newPosition.width = fullWindowWidth * 0.4f;
                GUI.Label(position, info.englishName + " - " + info.languageCode);

                float buttonWidth = fullWindowWidth * 0.2f;
                buttonWidth = Mathf.Clamp(buttonWidth, 70, 120);

                newPosition.width = buttonWidth;
                newPosition.x     = fullWindowWidth - buttonWidth;

                if (GUI.Button(newPosition, "Обновить"))
                {
                    LanguageUpdateWindow.ShowWindow(info, this);
                }
                newPosition.x -= buttonWidth;
                if (GUI.Button(newPosition, "Экспорт"))
                {
                    LanguageExportWindow.ShowWindow(info);
                }
                newPosition.x -= buttonWidth;
                if (GUI.Button(newPosition, "Перевести"))
                {
                    OnTranslateButtonClick(info);
                }
            }
            else
            {
                position.width += 28;
                if (GUI.Button(position, "Редактировать файл корневого языка"))
                {
                    OnRootEditClick();
                }
            }
            return(info);
        }