Skip to content

Commit

Permalink
com.unity.textmeshpro@1.5.0-preview.4
Browse files Browse the repository at this point in the history
## [1.5.0-preview.4] - 2020-01-31
## [2.1.0-preview.4]
## [3.0.0-preview.4]
### Changes
- Fixed Input Field issue where scrolling events could prevent OnEndEdit event from firing. See [forum post](https://forum.unity.com/threads/mouse-wheel-on-multiline-input-field-with-no-scrollbar-hangs-input-field-stops-event-firing.794607/) for details.
- Improved Input Field handling of Vertical Scrollbar in conjunction with the ResetOnDeActivation property. Using the Vertical Scrollbar no longer triggers OnEndEdit event.
- Fixed MissingReferenceException when deleting a TMP prefab that is part of a nested prefab. Case #1207793
- Improved handling of allocations of newly created text objects with large amount of text. As a result of these revisions, allocations will potentially be reduce by 10X. See #1205923
- Fixed potential Null Reference Exception with the TMP DropDown that could occur when using the experimental Editor "Enter Play Mode" feature. Case #1207915
- Fixed potential issue with the assignment of sub text object materials.
- Add support for hiding the soft keyboard for Switch in the TMP Input Field.
- Fixed incorrect Preferred Height when Word Wrapping is disabled on text objects. See [forum post](https://forum.unity.com/threads/incorrect-wordwrapping-preferredsize-textmespro-2-1-preview-3.812376/) for details.
- Fixed additional instances of TMP Resource Importer window being created when deleting the "TextMesh Pro" folder just after having imported them. Case #1205848
- Added public ITextPreprocessor textPreprocessor; property to allow setting the text preprocessor for a given text component.
  • Loading branch information
Unity Technologies committed Jan 30, 2020
1 parent 1185c75 commit 52c49e2
Show file tree
Hide file tree
Showing 14 changed files with 508 additions and 342 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Changelog
These are the release notes for the TextMesh Pro UPM package which was first introduced with Unity 2018.1. Please see the following link for the Release Notes for prior versions of TextMesh Pro. http://digitalnativestudios.com/forum/index.php?topic=1363.0

## [1.5.0-preview.4] - 2020-01-31
## [2.1.0-preview.4]
## [3.0.0-preview.4]
### Changes
- Fixed Input Field issue where scrolling events could prevent OnEndEdit event from firing. See [forum post](https://forum.unity.com/threads/mouse-wheel-on-multiline-input-field-with-no-scrollbar-hangs-input-field-stops-event-firing.794607/) for details.
- Improved Input Field handling of Vertical Scrollbar in conjunction with the ResetOnDeActivation property. Using the Vertical Scrollbar no longer triggers OnEndEdit event.
- Fixed MissingReferenceException when deleting a TMP prefab that is part of a nested prefab. Case #1207793
- Improved handling of allocations of newly created text objects with large amount of text. As a result of these revisions, allocations will potentially be reduce by 10X. See #1205923
- Fixed potential Null Reference Exception with the TMP DropDown that could occur when using the experimental Editor "Enter Play Mode" feature. Case #1207915
- Fixed potential issue with the assignment of sub text object materials.
- Add support for hiding the soft keyboard for Switch in the TMP Input Field.
- Fixed incorrect Preferred Height when Word Wrapping is disabled on text objects. See [forum post](https://forum.unity.com/threads/incorrect-wordwrapping-preferredsize-textmespro-2-1-preview-3.812376/) for details.
- Fixed additional instances of TMP Resource Importer window being created when deleting the "TextMesh Pro" folder just after having imported them. Case #1205848
- Added public ITextPreprocessor textPreprocessor; property to allow setting the text preprocessor for a given text component.

## [1.5.0-preview.3] - 2019-12-16
## [2.1.0-preview.3]
### Changes
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Editor/TMPro_CreateObjectMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static void CreateTextMeshProGuiObjectPerform(MenuCommand menuCommand)
GameObject go = TMP_DefaultControls.CreateText(GetStandardResources());

// Override text color and font size
TextMeshProUGUI textComponent = go.GetComponent<TextMeshProUGUI>();
TextMeshProUGUI textComponent = go.GetComponent<TextMeshProUGUI>();

if (textComponent.m_isWaitingOnResourceLoad == false)
{
Expand Down
10 changes: 5 additions & 5 deletions Scripts/Runtime/TMP_Dropdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ protected TMP_Dropdown() { }

protected override void Awake()
{
#if UNITY_EDITOR
if (!Application.isPlaying)
return;
#endif
//#if UNITY_EDITOR
// if (!Application.isPlaying)
// return;
//#endif

m_AlphaTweenRunner = new TweenRunner<FloatTween>();
m_AlphaTweenRunner.Init(this);
Expand Down Expand Up @@ -1157,4 +1157,4 @@ private void OnSelectItem(Toggle toggle)
Hide();
}
}
}
}
2 changes: 1 addition & 1 deletion Scripts/Runtime/TMP_FontFeatureTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TMP_FontFeatureTable
/// <summary>
/// List that contains the glyph pair adjustment records.
/// </summary>
internal List<TMP_GlyphPairAdjustmentRecord> glyphPairAdjustmentRecords
public List<TMP_GlyphPairAdjustmentRecord> glyphPairAdjustmentRecords
{
get { return m_GlyphPairAdjustmentRecords; }
set { m_GlyphPairAdjustmentRecords = value; }
Expand Down
73 changes: 46 additions & 27 deletions Scripts/Runtime/TMP_InputField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ public bool shouldHideSoftKeyboard
case RuntimePlatform.WSAPlayerX86:
case RuntimePlatform.WSAPlayerX64:
case RuntimePlatform.WSAPlayerARM:
case RuntimePlatform.Switch:
return m_HideSoftKeyboard;
default:
return true;
Expand All @@ -438,6 +439,7 @@ public bool shouldHideSoftKeyboard
case RuntimePlatform.WSAPlayerX86:
case RuntimePlatform.WSAPlayerX64:
case RuntimePlatform.WSAPlayerARM:
case RuntimePlatform.Switch:
SetPropertyUtility.SetStruct(ref m_HideSoftKeyboard, value);
break;
default:
Expand All @@ -460,6 +462,7 @@ private bool isKeyboardUsingEvents()
case RuntimePlatform.Android:
case RuntimePlatform.IPhonePlayer:
case RuntimePlatform.tvOS:
case RuntimePlatform.Switch:
return false;
default:
return true;
Expand Down Expand Up @@ -730,7 +733,7 @@ public bool resetOnDeActivation
private bool m_SelectionStillActive = false;
private bool m_ReleaseSelection = false;

private GameObject m_SelectedObject;
private GameObject m_PreviouslySelectedObject;

/// <summary>
/// Controls whether the original text is restored when pressing "ESC".
Expand Down Expand Up @@ -1415,19 +1418,36 @@ protected virtual void LateUpdate()
{
GameObject selectedObject = EventSystem.current != null ? EventSystem.current.currentSelectedGameObject : null;

if (selectedObject == null && m_ResetOnDeActivation)
{
ReleaseSelection();
return;
}

if (selectedObject != null && selectedObject != this.gameObject)
{
if (selectedObject != m_SelectedObject)
if (selectedObject != m_PreviouslySelectedObject)
{
m_SelectedObject = selectedObject;
m_PreviouslySelectedObject = selectedObject;

// Release current selection of the newly selected object is another Input Field
if (selectedObject.GetComponent<TMP_InputField>() != null)
// Special handling for Vertical Scrollbar
if (m_VerticalScrollbar && selectedObject == m_VerticalScrollbar.gameObject)
{
// Release selection
m_SelectionStillActive = false;
MarkGeometryAsDirty();
m_SelectedObject = null;
// Do not release selection
return;
}
else
{
// Release selection for all objects when ResetOnDeActivation is true
if (m_ResetOnDeActivation)
{
ReleaseSelection();
return;
}

// Release current selection of selected object is another Input Field
if (selectedObject.GetComponent<TMP_InputField>() != null)
ReleaseSelection();
}
}

Expand All @@ -1454,9 +1474,7 @@ protected virtual void LateUpdate()
//if (caretRectTrans != null)
// caretRectTrans.localPosition = Vector3.zero;

m_SelectionStillActive = false;

MarkGeometryAsDirty();
ReleaseSelection();

return;
}
Expand Down Expand Up @@ -2118,7 +2136,12 @@ public virtual void OnUpdateSelected(BaseEventData eventData)
/// <param name="eventData"></param>
public virtual void OnScroll(PointerEventData eventData)
{
if (m_TextComponent.preferredHeight < m_TextViewport.rect.height) return;
// Return if Single Line
if (m_LineType == LineType.SingleLine)
return;

if (m_TextComponent.preferredHeight < m_TextViewport.rect.height)
return;

float scrollDirection = -eventData.scrollDelta.y;

Expand All @@ -2128,9 +2151,6 @@ public virtual void OnScroll(PointerEventData eventData)

AdjustTextPositionRelativeToViewport(m_ScrollPosition);

// Disable focus until user re-selected the input field.
m_AllowInput = false;

if (m_VerticalScrollbar)
{
m_IsUpdatingScrollbarValues = true;
Expand Down Expand Up @@ -3946,7 +3966,13 @@ public void OnControlClick()
public void ReleaseSelection()
{
m_SelectionStillActive = false;
m_ReleaseSelection = false;
m_PreviouslySelectedObject = null;

MarkGeometryAsDirty();

SendOnEndEdit();
SendOnEndTextSelection();
}

public void DeactivateInputField(bool clearSelection = false)
Expand Down Expand Up @@ -3981,18 +4007,11 @@ public void DeactivateInputField(bool clearSelection = false)
//m_StringPosition = m_StringSelectPosition = 0;
//m_CaretPosition = m_CaretSelectPosition = 0;
//m_TextComponent.rectTransform.localPosition = m_DefaultTransformPosition;

//if (caretRectTrans != null)
// caretRectTrans.localPosition = Vector3.zero;

m_SelectionStillActive = false;
m_ReleaseSelection = false;
m_SelectedObject = null;

if (m_VerticalScrollbar == null)
ReleaseSelection();
}

SendOnEndEdit();
SendOnEndTextSelection();

inputSystem.imeCompositionMode = IMECompositionMode.Auto;
}

Expand Down Expand Up @@ -4327,4 +4346,4 @@ public static bool SetClass<T>(ref T currentValue, T newValue) where T : class
return true;
}
}
}
}
12 changes: 9 additions & 3 deletions Scripts/Runtime/TMP_PackageResourceImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,17 @@ public class TMP_PackageResourceImporterWindow : EditorWindow
[SerializeField]
TMP_PackageResourceImporter m_ResourceImporter;

static TMP_PackageResourceImporterWindow m_ImporterWindow;

public static void ShowPackageImporterWindow()
{
var window = GetWindow<TMP_PackageResourceImporterWindow>();
window.titleContent = new GUIContent("TMP Importer");
window.Focus();
if (m_ImporterWindow == null)
{
m_ImporterWindow = GetWindow<TMP_PackageResourceImporterWindow>();
m_ImporterWindow.titleContent = new GUIContent("TMP Importer");
}

m_ImporterWindow.Focus();
}

void OnEnable()
Expand Down
10 changes: 7 additions & 3 deletions Scripts/Runtime/TMP_SubMeshUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,13 @@ protected override void OnEnable()
protected override void OnDisable()
{
//Debug.Log("*** SubObject OnDisable() ***");
//base.OnDisable();

//m_canvasRenderer.Clear();
TMP_UpdateRegistry.UnRegisterCanvasElementForRebuild(this);
//TMP_UpdateRegistry.UnRegisterCanvasElementForRebuild(this);

if (canvasRenderer != null)
canvasRenderer.Clear();

if (m_MaskMaterial != null)
{
Expand All @@ -289,8 +293,6 @@ protected override void OnDisable()
TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
m_fallbackMaterial = null;
}

base.OnDisable();
}


Expand Down Expand Up @@ -518,6 +520,8 @@ public override Material GetModifiedMaterial(Material baseMaterial)

m_MaskMaterial = mat;
}
else if (m_MaskMaterial != null)
TMP_MaterialManager.ReleaseStencilMaterial(m_MaskMaterial);

return mat;
}
Expand Down
Loading

0 comments on commit 52c49e2

Please sign in to comment.