public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label) { var termRect = rect; termRect.xMax -= 50; var termProp = property.FindPropertyRelative("mTerm"); TermsPopup_Drawer.ShowGUI(termRect, termProp, label, null); var maskRect = rect; maskRect.xMin = maskRect.xMax - 30; var termIgnoreRTL = property.FindPropertyRelative("mRTL_IgnoreArabicFix"); var termConvertNumbers = property.FindPropertyRelative("mRTL_ConvertNumbers"); int mask = (termIgnoreRTL.boolValue ? 0 : 1) + (termConvertNumbers.boolValue ? 0 : 2); int newMask = EditorGUI.MaskField(maskRect, mask, new string[] { "Arabic Fix", "Ignore Numbers in RTL" }); if (newMask != mask) { termIgnoreRTL.boolValue = (newMask & 1) == 0; termConvertNumbers.boolValue = (newMask & 2) == 0; } var showRect = rect; showRect.xMin = termRect.xMax; showRect.xMax = maskRect.xMin; bool enabled = GUI.enabled; GUI.enabled = enabled & (!string.IsNullOrEmpty(termProp.stringValue) && termProp.stringValue != "-"); if (GUI.Button(showRect, "?")) { var source = LocalizationManager.GetSourceContaining(termProp.stringValue); LocalizationEditor.mKeyToExplore = termProp.stringValue; Selection.activeObject = source; } GUI.enabled = enabled; }
void OnGUI_StoreIntegration() { GUIStyle lstyle = new GUIStyle(EditorStyles.label); lstyle.richText = true; GUILayout.BeginHorizontal(); GUILayout.Label(new GUIContent("Store Integration:", "Setups the stores to detect that the game has localization, Android adds strings.xml for each language. IOS modifies the Info.plist"), EditorStyles.boldLabel, GUILayout.Width(160)); GUILayout.FlexibleSpace(); GUILayout.Label(new GUIContent("<color=green><size=16>\u2713</size></color> IOS", "Setups the stores to show in iTunes and the Appstore all the languages that this app supports, also localizes the app name if available"), lstyle, GUILayout.Width(90)); GUILayout.Label(new GUIContent("<color=green><size=16>\u2713</size></color> Android", "Setups the stores to show in GooglePlay all the languages this app supports, also localizes the app name if available"), lstyle, GUILayout.Width(90)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); mAppNameTerm_Expanded = GUILayout.Toggle(mAppNameTerm_Expanded, new GUIContent("App Name translations:", "How should the game be named in the devices based on their language"), EditorStyles.foldout, GUILayout.Width(160)); GUILayout.Label("", GUILayout.ExpandWidth(true)); var rect = GUILayoutUtility.GetLastRect(); TermsPopup_Drawer.ShowGUI(rect, mProp_AppNameTerm, GUITools.EmptyContent, mLanguageSource); if (GUILayout.Button("New Term", EditorStyles.miniButton, GUILayout.ExpandWidth(false))) { AddLocalTerm("App_Name"); mProp_AppNameTerm.stringValue = "App_Name"; mAppNameTerm_Expanded = true; } GUILayout.EndHorizontal(); if (mAppNameTerm_Expanded) { GUILayout.BeginHorizontal(); GUILayout.Space(10); GUILayout.BeginVertical("Box"); var termName = mProp_AppNameTerm.stringValue; if (!string.IsNullOrEmpty(termName)) { var termData = LocalizationManager.GetTermData(termName); if (termData != null) { OnGUI_Keys_Languages(mProp_AppNameTerm.stringValue, ref termData, null, true, mLanguageSource); } } GUILayout.Space(10); GUILayout.BeginHorizontal(); GUILayout.Label("<b>Default App Name:</b>", lstyle, GUITools.DontExpandWidth); GUILayout.Label(Application.productName); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); } }
public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label) { var termRect = rect; termRect.xMax -= 25; var termProp = property.FindPropertyRelative("mTerm"); TermsPopup_Drawer.ShowGUI(termRect, termProp, label, null); var maskRect = rect; maskRect.xMin = maskRect.xMax - 25; var termIgnoreRTL = property.FindPropertyRelative("mRTL_IgnoreArabicFix"); var termConvertNumbers = property.FindPropertyRelative("mRTL_ConvertNumbers"); int mask = (termIgnoreRTL.boolValue ? 0 : 1) + (termConvertNumbers.boolValue ? 0 : 2); int newMask = EditorGUI.MaskField(maskRect, mask, new string[] { "Arabic Fix", "Ignore Numbers in RTL" }); if (newMask != mask) { termIgnoreRTL.boolValue = (newMask & 1) == 0; termConvertNumbers.boolValue = (newMask & 2) == 0; } }