Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Dengao on May 30, 2017, 04:32:19 AM

Title: button OnClick() dosent work from 3.8.2 to 3.11.2
Post by: Dengao on May 30, 2017, 04:32:19 AM
Hey. I recently upgraded NGUI version from 3.8.2 to 3.11.2 and Onclick() dosent seems to work when my tooltipDelay is 0, and i want it to be 0. I had the same problem when i upgraded to 3.8.2 a long time ago, but i fixed it with this fix: http://www.tasharen.com/forum/index.php?topic=12948.msg58584#msg58584

Anyway this fix dosent help anymore:( I would appreciate some help on this matter.

Btw im talking about mouse clicking on buttons with Onclick functions.

thanks in advance.
Title: Re: button OnClick() dosent work from 3.8.2 to 3.11.2
Post by: ArenMook on June 05, 2017, 03:41:19 AM
Wouldn't simply adding a zero check work?
  1.                         // Hold event = show tooltip
  2.                         if (tooltipDelay != 0f && currentTouch.deltaTime > tooltipDelay) // <-- here
  3.                         {
  4.                                 if (currentTouch.pressed == currentTouch.current && mTooltipTime != 0f && !currentTouch.dragStarted)
  5.                                 {
  6.                                         mTooltipTime = 0f;
  7.                                         currentTouch.clickNotification = ClickNotification.None;
  8.                                         if (longPressTooltip) ShowTooltip(currentTouch.pressed);
  9.                                         Notify(currentTouch.current, "OnLongPress", null);
  10.                                 }
  11.                         }
Title: Re: button OnClick() dosent work from 3.8.2 to 3.11.2
Post by: Dengao on June 21, 2017, 12:05:59 PM
Thanks MATE! You sure are right!  :D