Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JSwigart

Pages: [1]
1
NGUI 3 Support / Re: Text Area with WYSIWYG features
« on: March 06, 2019, 03:23:44 PM »
Is this still the case in the latest NGUI? We too would like to have an in-game WYSIWYG text area

2
NGUI 3 Support / Re: UIDragScrollView usage
« on: July 15, 2017, 09:14:05 AM »
In a mouse up handler of our drag and drop system we are triggering a quick move of the icon, and part of that functionality destroys the icon, because where it is moved to has a different representation. None of that logic is drag related, just a click based quick move, but since the UIDragScrollView has already forwarded the OnPress(true) to the underlying scroll view to set the mPressed variable, the OnPress(false) half of that press event is ignored due to the UIDragScrollView being disabled.

Seems that the UIScrollView relies on the receipt of both sides of an OnPress event or scrolling breaks in this manner, and that isn't a reliable guarantee with the many different intermediate components that could be disabled and break the propagation of the false half of that.

I was tempted to do a Notify(currentTouch.pressed, "OnPress", false); before destroying the icon to clear any lingering mPressed related issues with the underlying ScrollView, but then the Press of UIScrollView doesn't seem protected against getting a false event when it isn't in it's true state, so for instance, sending OnPress(false) will invoke any onDragFinished callbacks whether or not it was in mPressed = true state before that, so I could be introducing different bugs.

3
NGUI 3 Support / Re: UIDragScrollView usage
« on: July 12, 2017, 10:51:45 PM »
Sorry, I posted too soon.

So the question is. Am I using NGUI wrongly in some situation, or is this the unhandled edge case that it seems to be?

I'm tempted to remove the active checks in UIDragScrollView.OnPress so that the unpress will go through properly but I wanted to ask if there was a more proper fix for this someone would recommend.

4
NGUI 3 Support / UIDragScrollView usage
« on: July 12, 2017, 10:48:19 PM »
I have a grid of objects within a scroll view, there is also a single large "background" item with a UIDragScrollView such that you can drag anywhere within the scroll view to scroll it, as one would expect. Once items are added to the grid, by default you cannot drag on the items themselves to still invoke the scroll view dragging. As I understand it, the fix for this is to add a UIDragScrollView to each of the items as well, and indeed this seems to work.

Assuming all that is proper usage, I've encountered an issue that appears to require a fix within NGUI itself.

Since my grid items now have UIDragScrollView, they forward OnPress events to the underlying scroll view. The issue is that if any of my custom logic, such as a click event on the object itself, removes or disables the item in the grid(as is the case with the inventory swapping I am debugging), when that grid item gets the OnPress(false) to notify of the release, the item is disabled, so that event is not forwarded to the scroll view. This leaves the scroll view in a mPressed = true state and scrolling is broken, because LateUpdate doesn't apply the mScroll, and zeroes it out in the else from

  1. // Apply momentum
  2.                 if (mShouldMove && !mPressed)

Pages: [1]