public override void OnInspectorGUI() { serializedObject.UpdateIfDirtyOrScript(); terms = LocalizationManager.GetTermsList(); terms.Sort(System.StringComparer.OrdinalIgnoreCase); terms.Add(""); terms.Add("<inferred from text>"); terms.Add("<none>"); GUI.backgroundColor = Color.Lerp(Color.black, Color.gray, 1); GUILayout.BeginVertical(LocalizeInspector.GUIStyle_Background); GUI.backgroundColor = Color.white; if (GUILayout.Button("Localize DropDown", LocalizeInspector.GUIStyle_Header)) { Application.OpenURL(LocalizeInspector.HelpURL_Documentation); } GUILayout.Space(5); mList.DoLayoutList(); GUILayout.Space(10); I2AboutWindow.OnGUI_Footer("I2 Localization", LocalizationManager.GetVersion(), LocalizeInspector.HelpURL_forum, LocalizeInspector.HelpURL_Documentation); EditorGUIUtility.labelWidth = 0; GUILayout.EndVertical(); serializedObject.ApplyModifiedProperties(); terms = null; }
public override void OnInspectorGUI() { // Load Test: /*if (mLanguageSource.mTerms.Count<40000) * { * mLanguageSource.mTerms.Clear(); * for (int i=0; i<40020; ++i) * mLanguageSource.AddTerm("ahh"+i.ToString("00000"), eTermType.Text, false); * mLanguageSource.UpdateDictionary(); * }*/ //Profiler.maxNumberOfSamplesPerFrame = -1; // REMOVE --------------------------------------------------- mIsParsing = false; //#if UNITY_5_6_OR_NEWER // serializedObject.UpdateIfRequiredOrScript(); //#else // serializedObject.UpdateIfDirtyOrScript(); //#endif if (mLanguageSource.mTerms.Count < 1000) { Undo.RecordObject(target, "LanguageSource"); } GUI.backgroundColor = Color.Lerp(Color.black, Color.gray, 1); GUILayout.BeginVertical(LocalizeInspector.GUIStyle_Background); GUI.backgroundColor = Color.white; if (GUILayout.Button("Language Source", LocalizeInspector.GUIStyle_Header)) { Application.OpenURL(LocalizeInspector.HelpURL_Documentation); } InitializeStyles(); GUILayout.Space(10); OnGUI_Main(); GUILayout.Space(10); GUILayout.FlexibleSpace(); I2AboutWindow.OnGUI_Footer("I2 Localization", LocalizationManager.GetVersion(), LocalizeInspector.HelpURL_forum, LocalizeInspector.HelpURL_Documentation); GUILayout.EndVertical(); serializedObject.ApplyModifiedProperties(); }
public static void AboutWindow() { I2AboutWindow.DoShowScreen(); }
public override void OnInspectorGUI() { Undo.RecordObject(target, "Localize"); GUI.backgroundColor = Color.Lerp(Color.black, Color.gray, 1); GUILayout.BeginVertical(GUIStyle_Background, GUILayout.Height(1)); GUI.backgroundColor = Color.white; if (GUILayout.Button("Localize", GUIStyle_Header)) { //Application.OpenURL(HelpURL_Documentation); } GUILayout.Space(-10); LocalizationManager.UpdateSources(); if (LocalizationManager.Sources.Count == 0) { EditorGUILayout.HelpBox("Unable to find a Language Source.", MessageType.Warning); } else { GUILayout.Space(10); OnGUI_Target(); GUILayout.Space(10); OnGUI_Terms(); //if (mGUI_ShowTems || mGUI_ShowReferences) GUILayout.Space(5); OnGUI_References(); if (mLocalize.mGUI_ShowReferences || mLocalize.mGUI_ShowCallback) { GUILayout.Space(10); } Localize loc = target as Localize; //--[ Localize Callback ]---------------------- string HeaderTitle = "On Localize Call:"; if (!mLocalize.mGUI_ShowCallback && loc.LocalizeCallBack.Target != null && !string.IsNullOrEmpty(loc.LocalizeCallBack.MethodName)) { HeaderTitle = string.Concat(HeaderTitle, " <b>", loc.LocalizeCallBack.Target.name, ".</b><i>", loc.LocalizeCallBack.MethodName, "</i>"); } mLocalize.mGUI_ShowCallback = GUITools.DrawHeader(HeaderTitle, mLocalize.mGUI_ShowCallback); if (mLocalize.mGUI_ShowCallback) { GUITools.BeginContents(); DrawEventCallBack(loc.LocalizeCallBack, loc); GUITools.EndContents(); } } OnGUI_Source(); GUILayout.Space(10); I2AboutWindow.OnGUI_Footer("I2 Localization", LocalizationManager.GetVersion(), LocalizeInspector.HelpURL_forum, LocalizeInspector.HelpURL_Documentation); GUILayout.EndVertical(); serializedObject.ApplyModifiedProperties(); }