Skip to content

Commit

Permalink
hide default tooltip after a while
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerbarton committed Jul 10, 2020
1 parent 243aa78 commit 9811e6f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Assets/Scripts/UI/Hints/UiInputHints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class UiInputHints : MonoBehaviour

private LibiglBehaviour _activeBehaviour;

private const float DefaultTooltipTimeout = 60f;

public void Initialize()
{
title.Initialize();
Expand Down Expand Up @@ -118,6 +120,8 @@ public void Repaint()

break;
}

ClearTooltip();
}

#region Custom Functionality
Expand Down Expand Up @@ -190,7 +194,10 @@ private void SetTooltip(string data, bool overrideExisting = false)

private void ClearTooltip()
{
help.ResetToData();
if(Time.time > DefaultTooltipTimeout)
help.SetData(new UiInputLabelData{isOverride = true, isActive = false});
else
help.ResetToData();
}

#endregion
Expand Down

0 comments on commit 9811e6f

Please sign in to comment.