void DrawSearchField(Rect position) { float fullWindowWidth = position.width + 30; Rect newPosition = position; newPosition.width = fullWindowWidth * 0.69f; searchText = EditorGUI.TextField(newPosition, "Search", searchText); newPosition.x += fullWindowWidth * 0.7f; newPosition.width = fullWindowWidth * 0.29f; searchType = (LanguageSearchType)EditorGUI.EnumPopup(newPosition, searchType); localizedObjectAdaptor.SearchType = searchType; localizedObjectAdaptor.SearchLine = searchText; }
string DrawSettingsItem(Rect position, string item) { float fullWindowWidth = position.width + 30; Rect newPosition = position; newPosition.width = fullWindowWidth * 0.99f; if (item == "GENERAL") { bool collapse = EditorGUI.Toggle(newPosition, "Collapse multiline fields", collapseMultilineFields); if (collapse != collapseMultilineFields) { collapseMultilineFields = collapse; localizedObjectAdaptor.collapseMultiline = collapse; EditorPrefs.SetBool(CollapseMultilineSaveKey, collapseMultilineFields); } } else if (item == "SEARCH") { newPosition.width = fullWindowWidth * 0.69f; searchText = EditorGUI.TextField(newPosition, "Search", searchText); newPosition.x += fullWindowWidth * 0.7f; newPosition.width = fullWindowWidth * 0.29f; searchType = (LanguageSearchType)EditorGUI.EnumPopup(newPosition, searchType); localizedObjectAdaptor.SearchType = searchType; localizedObjectAdaptor.SearchLine = searchText; } else if (item == "CONVERTLINEBREAK") { if (GUI.Button(newPosition, @"Convert all '\n' into line breaks")) { OnConvertLinebreaksClick(); } } else if (item == "IMPORT") { if (GUI.Button(newPosition, "Import Root Keys")) { LanguageRootImport.ShowWindow(this); } } return(item); }
string DrawSettingsItem(Rect position, string item) { float fullWindowWidth = position.width + 30; Rect newPosition = position; newPosition.width = fullWindowWidth * 0.99f; if (item == "GENERAL") { bool collapse = EditorGUI.Toggle(newPosition, "Свернуть многострочные поля", collapseMultilineFields); if (collapse != collapseMultilineFields) { collapseMultilineFields = collapse; localizedObjectAdaptor.collapseMultiline = collapse; EditorPrefs.SetBool(CollapseMultilineSaveKey, collapseMultilineFields); } } else if (item == "SEARCH") { newPosition.width = fullWindowWidth * 0.69f; searchText = EditorGUI.TextField(newPosition, "Поиск", searchText); newPosition.x += fullWindowWidth * 0.7f; newPosition.width = fullWindowWidth * 0.29f; searchType = (LanguageSearchType)EditorGUI.EnumPopup(newPosition, searchType); localizedObjectAdaptor.SearchType = searchType; localizedObjectAdaptor.SearchLine = searchText; } else if (item == "CONVERTLINEBREAK") { if (GUI.Button(newPosition, @"Конвертировать все '\n' в разрывы строк")) { OnConvertLinebreaksClick(); } } return(item); }