Author Topic: button OnClick() dosent work from 3.8.2 to 3.11.2  (Read 5103 times)

Dengao

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 12
    • View Profile
button OnClick() dosent work from 3.8.2 to 3.11.2
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: button OnClick() dosent work from 3.8.2 to 3.11.2
« Reply #1 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.                         }

Dengao

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: button OnClick() dosent work from 3.8.2 to 3.11.2
« Reply #2 on: June 21, 2017, 12:05:59 PM »
Thanks MATE! You sure are right!  :D